/* ===== Nails Magic — Premium Responsive Theme ===== */
:root {
  --bg: #e8e2d8;
  --ink: #121212;
  --accent: #bfa183;
  --muted: #6f655a;
  --white: #ffffff;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);

  /* Mobile-specific spacing */
  --mobile-padding: clamp(1rem, 4vw, 2rem);
  --mobile-gap: clamp(0.75rem, 3vw, 1.5rem);
  --section-spacing: clamp(2rem, 6vw, 4rem);

  /* Touch targets */
  --touch-target-min: 44px;
  --touch-spacing: 8px;

  /* Navigation */
  --nav-height: 70px;
  --nav-overlay-bg: rgba(232, 226, 216, 0.95);

  /* Mobile Navigation */
  --sidebar-width: 280px;
  --sidebar-bg: rgba(232, 226, 216, 0.95);
  --sidebar-backdrop: rgba(0, 0, 0, 0.5);
  --hamburger-size: 24px;
  --hamburger-line-height: 2px;
  --hamburger-spacing: 6px;
  --sidebar-transition: transform 0.3s var(--animation-easing-luxury);
  --overlay-transition: opacity 0.3s var(--animation-easing-smooth);

  /* Enhanced Animation Configuration Variables - Fine-tuned for Premium Feel */
  --animation-duration: 0.7s;
  --animation-duration-fast: 400ms;
  --animation-duration-normal: 700ms;
  --animation-duration-slow: 950ms;
  --animation-duration-page-loader: 1200ms;
  --animation-duration-hover: 250ms;

  /* Sophisticated Easing Curves for Luxury Brand Perception */
  --animation-easing: cubic-bezier(0.25, 0.1, 0.25, 1);
  --animation-easing-elegant: cubic-bezier(0.23, 1, 0.32, 1);
  --animation-easing-bounce: cubic-bezier(0.68, -0.6, 0.32, 1.6);
  --animation-easing-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --animation-easing-premium: cubic-bezier(0.19, 1, 0.22, 1);
  --animation-easing-luxury: cubic-bezier(0.165, 0.84, 0.44, 1);

  --animation-delay: 0s;
  --animation-distance: 35px;
  --stagger-delay: 150ms;
  --stagger-sequence-delay: 120ms;
  --stagger-group-delay: 200ms;

  /* Performance thresholds */
  --animation-viewport-threshold: 0.1;
  --animation-mobile-threshold: 0.15;
  --animation-performance-threshold: 0.05;

  /* Touch optimization variables */
  --touch-feedback-duration: 0.1s;
  --touch-scale-factor: 0.98;
  --touch-active-bg: rgba(191, 161, 131, 0.1);
  --touch-transition: all var(--touch-feedback-duration) ease;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--mobile-padding);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
}

p {
  margin-bottom: 1rem;
}

/* Lists */
ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
  position: relative;
}

li:last-child {
  margin-bottom: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--animation-duration-hover) var(--animation-easing-luxury);
}

a:hover {
  color: var(--ink);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.875rem 1.75rem;
  border-radius: 12px;
  font-weight: 600;
  text-align: center;
  transition: all var(--animation-duration-hover) var(--animation-easing-luxury);
  cursor: pointer;
  border: none;
  font-size: 1rem;
  min-height: var(--touch-target-min);
  text-decoration: none;
  background: var(--accent);
  color: var(--white);
  /* Touch optimization */
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

.btn:hover {
  background: #a88b6f;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(191, 161, 131, 0.3);
  color: var(--white);
}

.btn-accent {
  background: var(--accent);
  color: var(--white) !important;
}

.btn-accent:hover {
  background: #a88b6f;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(191, 161, 131, 0.3);
  color: var(--white) !important;
}

/* Specific rule for navigation Book now button */
.nav-links .btn-accent,
.navbar .btn-accent {
  color: #ffffff !important;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: var(--white);
}

/* Badge */
.badge {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  background: rgba(191, 161, 131, 0.15);
  color: var(--accent);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Navigation */
.navbar {
  background: var(--bg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-height);
}

.navbar .inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--nav-height);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  color: var(--ink);
  transition: color 0.2s ease;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.brand:hover {
  color: var(--accent);
}

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: var(--hamburger-size);
  height: var(--hamburger-size);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  min-height: var(--touch-target-min);
  min-width: var(--touch-target-min);
  z-index: 1001;
  position: relative;
  /* Touch optimization */
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

.hamburger span {
  display: block;
  height: var(--hamburger-line-height);
  width: 100%;
  background: var(--ink);
  border-radius: 1px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: 0.25s ease-in-out;
  transform-origin: left center;
}

.hamburger span:nth-child(1) {
  top: 0px;
}

.hamburger span:nth-child(2) {
  top: var(--hamburger-spacing);
}

.hamburger span:nth-child(3) {
  top: calc(var(--hamburger-spacing) * 2);
}

/* Hamburger Animation */
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg);
  top: -2px;
  left: 6px;
}

.hamburger.active span:nth-child(2) {
  width: 0%;
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg);
  top: 16px;
  left: 6px;
}

/* Navigation Overlay */
.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--sidebar-backdrop);
  opacity: 0;
  visibility: hidden;
  transition: var(--overlay-transition);
  z-index: 999;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Mobile Navigation Sidebar */
.nav-links {
  position: fixed;
  top: 0;
  right: -100%;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  transition: var(--sidebar-transition);
  z-index: 1002;
  overflow-y: auto;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
}

.nav-links.active {
  right: 0;
}

/* Sidebar Header */
.sidebar-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.sidebar-title {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.menu-text {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 3px;
  text-transform: uppercase;
  font-style: italic;
  text-align: center;
  padding: 0.5rem 0;
}

.close-btn {
  display: none;
}

/* Sidebar Navigation */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.sidebar-nav a {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  min-height: var(--touch-target-min);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.sidebar-nav a:hover {
  background: rgba(191, 161, 131, 0.15);
  color: var(--accent);
}

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.sidebar-footer .btn {
  width: 100%;
  justify-content: center;
}

/* Mobile-first: Show hamburger, hide desktop elements */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-overlay {
    display: block;
  }
}

/* Desktop navigation */
@media (min-width: 769px) {

  .hamburger,
  .nav-overlay {
    display: none !important;
  }

  .nav-links {
    position: static !important;
    width: auto !important;
    height: auto !important;
    background: none !important;
    flex-direction: row !important;
    justify-content: flex-end !important;
    align-items: center !important;
    padding: 0 !important;
    gap: 1.5rem !important;
    z-index: auto !important;
    transform: none !important;
    transition: none !important;
    box-shadow: none !important;
    overflow-y: visible !important;
    right: 0 !important;
  }

  .sidebar-header {
    display: none !important;
  }

  .sidebar-footer {
    display: flex !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    border-top: none !important;
  }

  .sidebar-footer .btn {
    width: auto !important;
    padding: 0.75rem 1.5rem !important;
  }

  .sidebar-nav {
    flex-direction: row !important;
    gap: 1.5rem !important;
    flex: none !important;
    margin-top: 0 !important;
  }

  .sidebar-nav a {
    padding: var(--touch-spacing) !important;
    min-height: auto !important;
    transform: none !important;
  }

  .sidebar-nav a:hover {
    background: none !important;
    transform: none !important;
    color: var(--accent) !important;
  }
}

/* Hardware Acceleration for Mobile Navigation */
.nav-links,
.nav-overlay,
.hamburger span {
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.nav-links.active,
.nav-overlay.active {
  will-change: auto;
}

/* Enhanced Mobile Navigation Animations */
@media (max-width: 768px) {
  .sidebar-nav a {
    transform: translateZ(0);
    justify-content: center !important;
    text-align: center !important;
    padding: 1rem 1.5rem !important;
  }

  .nav-links {
    transform: translateZ(0) translateX(100%);
  }

  .nav-links.active {
    transform: translateZ(0) translateX(0);
  }

  /* Center alignment for mobile sidebar navigation */
  .nav-links .sidebar-nav a {
    justify-content: center !important;
    text-align: center !important;
    padding: 1rem 1.5rem !important;
  }
}

/* Hero Section */
.hero {
  position: relative;
  padding: var(--section-spacing) 0;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: -10%;
  background-image: url("../assets/pattern.svg");
  background-repeat: repeat;
  opacity: 0.25;
  pointer-events: none;
}

.hero .content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--section-spacing);
  align-items: center;
  text-align: center;
}

.hero img.logo {
  width: clamp(150px, 25vw, 200px);
  height: clamp(150px, 25vw, 200px);
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  background-color: #fff;
  box-shadow: var(--shadow);
  margin: 0 auto;
}

.hero .logo-text {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--ink);
  margin-top: 0.8rem;
  text-align: center;
}

.hero .headline {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.1;
  margin-bottom: 1rem;
}

.hero p.lead {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: #3a3937;
  margin: 0.7rem 0 1.3rem;
  line-height: 1.5;
}

/* Desktop hero layout */
@media (min-width: 769px) {
  .hero .content {
    grid-template-columns: 1.2fr 0.8fr;
    gap: 3rem;
    text-align: left;
  }

  .hero img.logo {
    margin: 0 auto;
  }

  .hero .center {
    text-align: center !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .hero .logo-text {
    text-align: center !important;
    margin-top: 1.2rem;
    width: 100%;
  }

  .hero .flex {
    justify-content: flex-start !important;
  }
}

/* Mobile hero spacing */
@media (max-width: 768px) {
  .hero .flex {
    flex-direction: column;
    gap: var(--mobile-gap);
    align-items: center;
    justify-content: center;
  }

  .hero .btn {
    width: 100%;
    max-width: 280px;
    text-align: center;
  }
}

/* Desktop hero button layout */
@media (min-width: 769px) {
  .hero .flex {
    flex-direction: row !important;
    gap: 1.2rem;
    align-items: center;
    justify-content: flex-start !important;
  }

  .hero .btn {
    width: auto;
    min-width: 180px;
    padding: 1rem 2rem;
    font-size: 1rem;
    white-space: nowrap;
  }
}

/* Sections */
.section {
  padding: var(--section-spacing) 0;
}

/* Cards */
.card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: var(--mobile-padding);
}

/* Grid Layouts */
.grid {
  display: grid;
  gap: var(--mobile-gap);
}

.grid-3 {
  grid-template-columns: 1fr;
}

.grid-2 {
  grid-template-columns: 1fr;
}

@media (min-width: 769px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Service Items */
.service-item h3 {
  margin-top: 0.4rem;
}

.service-item p {
  color: #3f3e3c;
}

.price {
  font-weight: 700;
  color: var(--ink);
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--mobile-gap);
}

.gallery img,
.gallery video {
  width: 100%;
  height: auto;
  border-radius: 14px;
  box-shadow: var(--shadow);
  object-fit: cover;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

/* Swipe text styling */
.swipe-text {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
  text-align: center;
  margin: 1rem 0 0 0;
  opacity: 0.7;
  font-family: "Inter", sans-serif;
  letter-spacing: 0.5px;
}

/* Hide swipe text on desktop */
@media (min-width: 768px) {
  .swipe-text {
    display: none;
  }
}

.gallery img:hover,
.gallery video:hover {
  transform: scale(1.02);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

@media (hover: none) and (pointer: coarse) {

  .gallery img:active,
  .gallery video:active {
    transform: scale(0.98);
  }
}

@media (min-width: 480px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Split Layout */
.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--section-spacing);
  align-items: center;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2rem;
  }

  /* Contact page - only stretch the Quick Message form */
  .split .card:first-child {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
}

/* Footer */
.footer {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding: 2rem 0;
  margin-top: 2rem;
  font-size: 0.95rem;
  color: #3a3937;
}

.footer .cols {
  display: grid;
  gap: var(--mobile-gap);
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .footer .cols {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.footer .brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.5rem;
  transition: color 0.2s ease;
  justify-content: flex-start !important;
}

.footer .brand img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.footer .brand strong {
  font-weight: 700;
}

.footer a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .footer .cols {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .footer .brand {
    justify-content: flex-start !important;
    flex-direction: row !important;
    align-items: center !important;
    width: auto !important;
  }
}

.footer-bottom {
  margin-top: 20px;
  text-align: center;
  padding-top: 10px;
  border-top: 1px solid #ccc;
}

.github-link {
  color: #333;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: color 0.3s ease;
}

.github-link i {
  margin-right: 6px;
  font-size: 1.2rem;
}

.github-link:hover {
  color: #4078c0;
}

/* Utilities */
.mt-1 {
  margin-top: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mt-3 {
  margin-top: 1.5rem;
}

.flex {
  display: flex;
  flex-direction: row;
  gap: var(--mobile-gap);
  align-items: center;
  justify-content: center;
}

.flex>.btn+.btn {
  margin-left: var(--touch-spacing);
}

@media (min-width: 769px) {
  .flex {
    flex-direction: row !important;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
  }

  .flex .btn {
    width: auto;
    min-width: 180px;
    padding: 1rem 2rem;
    font-size: 1rem;
    white-space: nowrap;
  }
}

@media (max-width: 768px) {
  .flex {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
  }

  .flex .btn {
    width: 100%;
    max-width: 280px;
  }
}

.center {
  text-align: center;
}

/* Form Elements */
input,
textarea,
select {
  min-height: var(--touch-target-min);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(191, 161, 131, 0.2);
}

/* Link Touch Targets */
a:not(.btn) {
  padding: var(--touch-spacing);
  margin: calc(-1 * var(--touch-spacing));
  border-radius: 4px;
  transition: background 0.2s ease, color 0.2s ease;
  position: relative;
}

a:not(.btn):hover {
  background: rgba(191, 161, 131, 0.1);
  color: var(--accent);
}

a:not(.btn):active {
  background: rgba(191, 161, 131, 0.2);
  transform: scale(0.98);
}

/* ===== SCROLL REVEAL ANIMATION SYSTEM ===== */

/* Base Animation States */
.animate-element {
  opacity: 0;
  transform: translateY(var(--animation-distance));
  transition: opacity var(--animation-duration) var(--animation-easing),
    transform var(--animation-duration) var(--animation-easing);
  transition-delay: var(--animation-delay);
}

.animate-element.animate-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Fade In Animation */
.animate-fade-in {
  opacity: 0;
  transition: opacity var(--animation-duration) var(--animation-easing);
  transition-delay: var(--animation-delay);
}

.animate-fade-in.animate-visible {
  opacity: 1;
}

/* Slide Up Animation */
.animate-slide-up {
  opacity: 0;
  transform: translateY(var(--animation-distance));
  transition: opacity var(--animation-duration) var(--animation-easing),
    transform var(--animation-duration) var(--animation-easing);
  transition-delay: var(--animation-delay);
}

.animate-slide-up.animate-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Slide Down Animation */
.animate-slide-down {
  opacity: 0;
  transform: translateY(calc(-1 * var(--animation-distance)));
  transition: opacity var(--animation-duration) var(--animation-easing),
    transform var(--animation-duration) var(--animation-easing);
  transition-delay: var(--animation-delay);
}

.animate-slide-down.animate-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Scale In Animation */
.animate-scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity var(--animation-duration) var(--animation-easing),
    transform var(--animation-duration) var(--animation-easing);
  transition-delay: var(--animation-delay);
}

.animate-scale-in.animate-visible {
  opacity: 1;
  transform: scale(1);
}

/* Slide Left Animation */
.animate-slide-left {
  opacity: 0;
  transform: translateX(var(--animation-distance));
  transition: opacity var(--animation-duration) var(--animation-easing),
    transform var(--animation-duration) var(--animation-easing);
  transition-delay: var(--animation-delay);
}

.animate-slide-left.animate-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Slide Right Animation */
.animate-slide-right {
  opacity: 0;
  transform: translateX(calc(-1 * var(--animation-distance)));
  transition: opacity var(--animation-duration) var(--animation-easing),
    transform var(--animation-duration) var(--animation-easing);
  transition-delay: var(--animation-delay);
}

.animate-slide-right.animate-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Bounce In Animation - Premium Timing */
.animate-bounce-in {
  opacity: 0;
  transform: scale(0.3) translateY(var(--animation-distance));
  transition: opacity var(--animation-duration-slow) var(--animation-easing-bounce),
    transform var(--animation-duration-slow) var(--animation-easing-bounce);
  transition-delay: var(--animation-delay);
}

.animate-bounce-in.animate-visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* Enhanced Slide Animations with Premium Easing */
.animate-slide-up-enhanced {
  opacity: 0;
  transform: translateY(calc(var(--animation-distance) * 1.5));
  transition: opacity var(--animation-duration-normal) var(--animation-easing-premium),
    transform var(--animation-duration-normal) var(--animation-easing-premium);
  transition-delay: var(--animation-delay);
}

.animate-slide-up-enhanced.animate-visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-slide-down-enhanced {
  opacity: 0;
  transform: translateY(calc(-1 * var(--animation-distance) * 1.5));
  transition: opacity var(--animation-duration-normal) var(--animation-easing-premium),
    transform var(--animation-duration-normal) var(--animation-easing-premium);
  transition-delay: var(--animation-delay);
}

.animate-slide-down-enhanced.animate-visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-slide-left-enhanced {
  opacity: 0;
  transform: translateX(calc(var(--animation-distance) * 1.5));
  transition: opacity var(--animation-duration-normal) var(--animation-easing-premium),
    transform var(--animation-duration-normal) var(--animation-easing-premium);
  transition-delay: var(--animation-delay);
}

.animate-slide-left-enhanced.animate-visible {
  opacity: 1;
  transform: translateX(0);
}

.animate-slide-right-enhanced {
  opacity: 0;
  transform: translateX(calc(-1 * var(--animation-distance) * 1.5));
  transition: opacity var(--animation-duration-normal) var(--animation-easing-premium),
    transform var(--animation-duration-normal) var(--animation-easing-premium);
  transition-delay: var(--animation-delay);
}

.animate-slide-right-enhanced.animate-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Enhanced Scale In Animation */
.animate-scale-in-enhanced {
  opacity: 0;
  transform: scale(0.85);
  transition: opacity var(--animation-duration-normal) var(--animation-easing-elegant),
    transform var(--animation-duration-normal) var(--animation-easing-elegant);
  transition-delay: var(--animation-delay);
}

.animate-scale-in-enhanced.animate-visible {
  opacity: 1;
  transform: scale(1);
}

/* ===== PAGE LOADER ANIMATIONS ===== */

.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--bg) 0%, #f0ebe1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity var(--animation-duration-page-loader) var(--animation-easing-luxury),
    visibility var(--animation-duration-page-loader) var(--animation-easing-luxury);
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.page-loader-content {
  text-align: center;
  max-width: 300px;
  padding: 2rem;
}

.page-loader-logo {
  margin-bottom: 1.5rem;
  animation: logoFloat 2s var(--animation-easing-elegant) infinite alternate;
}

.page-loader-logo img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  box-shadow: 0 8px 32px rgba(191, 161, 131, 0.3);
  animation: logoGlow 3s var(--animation-easing-elegant) infinite;
}

.page-loader-text {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.5rem;
  opacity: 0;
  transform: translateY(20px);
  animation: textReveal 0.8s var(--animation-easing-premium) 0.3s forwards;
}

.page-loader-subtitle {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.5px;
  opacity: 0;
  transform: translateY(15px);
  animation: textReveal 0.8s var(--animation-easing-premium) 0.6s forwards;
}

.page-loader-progress {
  width: 100%;
  height: 2px;
  background: rgba(191, 161, 131, 0.2);
  border-radius: 1px;
  margin-top: 2rem;
  overflow: hidden;
  opacity: 0;
  animation: progressReveal 0.6s var(--animation-easing-elegant) 0.9s forwards;
}

.page-loader-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: progressSlide 1.5s var(--animation-easing-smooth) infinite;
}

/* Page Loader Keyframe Animations */
@keyframes logoFloat {
  0% {
    transform: translateY(0px);
  }

  100% {
    transform: translateY(-8px);
  }
}

@keyframes logoGlow {

  0%,
  100% {
    box-shadow: 0 8px 32px rgba(191, 161, 131, 0.3);
  }

  50% {
    box-shadow: 0 8px 40px rgba(191, 161, 131, 0.5);
  }
}

@keyframes textReveal {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes progressReveal {
  0% {
    opacity: 0;
    transform: scaleX(0);
  }

  100% {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes progressSlide {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

.animate-scale-in-enhanced {
  opacity: 0;
  transform: scale(0.8) rotate(-2deg);
  transition: opacity var(--animation-duration-normal) var(--animation-easing-elegant),
    transform var(--animation-duration-normal) var(--animation-easing-elegant);
  transition-delay: var(--animation-delay);
}

.animate-scale-in-enhanced.animate-visible {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* Enhanced Staggered Animation Support */
.animate-stagger>* {
  opacity: 0;
  transform: translateY(calc(-1 * var(--animation-distance)));
  transition: opacity var(--animation-duration-normal) var(--animation-easing-elegant),
    transform var(--animation-duration-normal) var(--animation-easing-elegant);
}

/* Enhanced stagger timing with 150ms intervals */
.animate-stagger.animate-visible>*:nth-child(1) {
  transition-delay: calc(0 * var(--stagger-delay));
}

.animate-stagger.animate-visible>*:nth-child(2) {
  transition-delay: calc(1 * var(--stagger-delay));
}

.animate-stagger.animate-visible>*:nth-child(3) {
  transition-delay: calc(2 * var(--stagger-delay));
}

.animate-stagger.animate-visible>*:nth-child(4) {
  transition-delay: calc(3 * var(--stagger-delay));
}

.animate-stagger.animate-visible>*:nth-child(5) {
  transition-delay: calc(4 * var(--stagger-delay));
}

.animate-stagger.animate-visible>*:nth-child(6) {
  transition-delay: calc(5 * var(--stagger-delay));
}

.animate-stagger.animate-visible>*:nth-child(7) {
  transition-delay: calc(6 * var(--stagger-delay));
}

.animate-stagger.animate-visible>*:nth-child(8) {
  transition-delay: calc(7 * var(--stagger-delay));
}

.animate-stagger.animate-visible>*:nth-child(9) {
  transition-delay: calc(8 * var(--stagger-delay));
}

.animate-stagger.animate-visible>*:nth-child(10) {
  transition-delay: calc(9 * var(--stagger-delay));
}

.animate-stagger.animate-visible>*:nth-child(11) {
  transition-delay: calc(10 * var(--stagger-delay));
}

.animate-stagger.animate-visible>*:nth-child(12) {
  transition-delay: calc(11 * var(--stagger-delay));
}

.animate-stagger.animate-visible>*:nth-child(13) {
  transition-delay: calc(12 * var(--stagger-delay));
}

.animate-stagger.animate-visible>*:nth-child(14) {
  transition-delay: calc(13 * var(--stagger-delay));
}

.animate-stagger.animate-visible>*:nth-child(15) {
  transition-delay: calc(14 * var(--stagger-delay));
}

.animate-stagger.animate-visible>* {
  opacity: 1;
  transform: translateY(0);
}

/* Enhanced Stagger Variants */
.animate-stagger-fast>* {
  opacity: 0;
  transform: translateY(calc(-1 * var(--animation-distance)));
  transition: opacity var(--animation-duration-fast) var(--animation-easing-smooth),
    transform var(--animation-duration-fast) var(--animation-easing-smooth);
}

.animate-stagger-fast.animate-visible>* {
  opacity: 1;
  transform: translateY(0);
}

.animate-stagger-fast.animate-visible>*:nth-child(n) {
  transition-delay: calc((var(--stagger-sequence-delay)) * (var(--nth-child, 0)));
}

.animate-stagger-bounce>* {
  opacity: 0;
  transform: scale(0.8) translateY(calc(-1 * var(--animation-distance)));
  transition: opacity var(--animation-duration-normal) var(--animation-easing-bounce),
    transform var(--animation-duration-normal) var(--animation-easing-bounce);
}

.animate-stagger-bounce.animate-visible>* {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* Enhanced Performance Optimization with Hardware Acceleration */
.animate-element,
.animate-fade-in,
.animate-slide-up,
.animate-slide-down,
.animate-scale-in,
.animate-slide-left,
.animate-slide-right,
.animate-bounce-in,
.animate-slide-up-enhanced,
.animate-slide-down-enhanced,
.animate-slide-left-enhanced,
.animate-slide-right-enhanced,
.animate-scale-in-enhanced,
.animate-stagger>*,
.animate-stagger-fast>*,
.animate-stagger-bounce>* {
  will-change: opacity, transform;
  transform: translateZ(0);
  /* Force hardware acceleration */
  backface-visibility: hidden;
  perspective: 1000px;
}

.animate-element.animate-visible,
.animate-fade-in.animate-visible,
.animate-slide-up.animate-visible,
.animate-slide-down.animate-visible,
.animate-scale-in.animate-visible,
.animate-slide-left.animate-visible,
.animate-slide-right.animate-visible,
.animate-bounce-in.animate-visible,
.animate-slide-up-enhanced.animate-visible,
.animate-slide-down-enhanced.animate-visible,
.animate-slide-left-enhanced.animate-visible,
.animate-slide-right-enhanced.animate-visible,
.animate-scale-in-enhanced.animate-visible,
.animate-stagger.animate-visible>*,
.animate-stagger-fast.animate-visible>*,
.animate-stagger-bounce.animate-visible>* {
  will-change: auto;
}

/* ===== MOBILE TOUCH OPTIMIZATIONS ===== */

/* Touch device detection and optimization */
@media (hover: none) and (pointer: coarse) {

  /* Disable hover effects on touch devices to prevent double-tap issues */
  .btn:hover,
  .btn-accent:hover,
  .btn-outline:hover,
  .brand:hover,
  .sidebar-nav a:hover,
  .footer a:hover,
  .github-link:hover,
  a:not(.btn):hover {
    /* Reset hover styles to default state */
    background: initial;
    color: initial;
    transform: none;
    box-shadow: initial;
    text-decoration: initial;
  }

  /* Restore default button colors on touch devices */
  .btn:hover {
    background: var(--accent);
    color: var(--white);
  }

  .btn-accent:hover {
    background: var(--accent);
    color: var(--white) !important;
  }

  .btn-outline:hover {
    background: transparent;
    color: var(--accent);
  }

  .brand:hover {
    color: var(--ink);
  }

  .sidebar-nav a:hover {
    color: var(--ink);
  }

  .footer a:hover {
    color: var(--accent);
  }

  .github-link:hover {
    color: #333;
  }

  a:not(.btn):hover {
    color: var(--accent);
  }

  /* Touch-specific active states for immediate feedback */
  .btn:active {
    background: #a88b6f;
    transform: scale(0.98);
    transition: all 0.1s ease;
  }

  .btn-accent:active {
    background: #a88b6f;
    transform: scale(0.98);
    transition: all 0.1s ease;
  }

  .btn-outline:active {
    background: rgba(191, 161, 131, 0.1);
    transform: scale(0.98);
    transition: all 0.1s ease;
  }

  .hamburger:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
  }

  .sidebar-nav a:active {
    background: rgba(191, 161, 131, 0.2);
    transform: scale(0.98);
    transition: all 0.1s ease;
  }

  .gallery img:active,
  .gallery video:active {
    transform: scale(0.98);
  }

  /* Ensure proper touch target sizes */
  .btn,
  .hamburger,
  .sidebar-nav a,
  input,
  textarea,
  select {
    min-height: var(--touch-target-min);
    min-width: var(--touch-target-min);
  }

  /* Prevent 300ms click delay on touch devices */
  .btn,
  .hamburger,
  .nav-overlay,
  .sidebar-nav a,
  .gallery img,
  .gallery video,
  a {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  }

  /* Touch-optimized transitions for immediate feedback */
  .btn,
  .btn-accent,
  .btn-outline,
  .hamburger,
  .sidebar-nav a {
    transition: all 0.1s ease;
  }
}

/* Hybrid device support (devices with both touch and mouse) */
@media (hover: hover) and (pointer: coarse) {

  /* Keep hover effects but make them less prominent for hybrid devices */
  .btn:hover {
    transform: translateY(-1px);
  }

  .btn-accent:hover {
    transform: translateY(-1px);
  }
}

/* Fine pointer devices (mouse-only) - keep full hover effects */
@media (hover: hover) and (pointer: fine) {

  /* Original hover effects are preserved for mouse users */
  .btn:hover {
    background: #a88b6f;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(191, 161, 131, 0.3);
    color: var(--white);
  }

  .btn-accent:hover {
    background: #a88b6f;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(191, 161, 131, 0.3);
    color: var(--white) !important;
  }
}

/* Mobile-specific touch optimizations */
@media (max-width: 768px) {

  /* Ensure all interactive elements meet touch target requirements */
  .btn {
    padding: 1rem 1.75rem;
    min-height: var(--touch-target-min);
  }

  .hamburger {
    min-height: var(--touch-target-min);
    min-width: var(--touch-target-min);
    padding: 10px;
  }

  .sidebar-nav a {
    padding: 1rem 1.5rem;
    min-height: var(--touch-target-min);
  }

  /* Optimize touch performance */
  .btn,
  .hamburger,
  .nav-overlay,
  .sidebar-nav a {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }

  /* Prevent accidental zooming on form inputs */
  input,
  textarea,
  select {
    font-size: 16px;
    /* Prevents zoom on iOS */
  }
}

/* GPU Acceleration for Mobile Devices */
@media (max-width: 768px) {

  .animate-element,
  .animate-fade-in,
  .animate-slide-up,
  .animate-slide-down,
  .animate-scale-in,
  .animate-slide-left,
  .animate-slide-right,
  .animate-bounce-in,
  .animate-slide-up-enhanced,
  .animate-slide-down-enhanced,
  .animate-slide-left-enhanced,
  .animate-slide-right-enhanced,
  .animate-scale-in-enhanced,
  .animate-stagger>*,
  .animate-stagger-fast>*,
  .animate-stagger-bounce>* {
    transform: translate3d(0, var(--animation-distance), 0);
  }

  .animate-slide-up,
  .animate-slide-up-enhanced {
    transform: translate3d(0, var(--animation-distance), 0);
  }

  .animate-slide-down,
  .animate-slide-down-enhanced {
    transform: translate3d(0, calc(-1 * var(--animation-distance)), 0);
  }

  .animate-slide-left,
  .animate-slide-left-enhanced {
    transform: translate3d(var(--animation-distance), 0, 0);
  }

  .animate-slide-right,
  .animate-slide-right-enhanced {
    transform: translate3d(calc(-1 * var(--animation-distance)), 0, 0);
  }
}

/* Enhanced Accessibility: Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

  .animate-element,
  .animate-fade-in,
  .animate-slide-up,
  .animate-slide-down,
  .animate-scale-in,
  .animate-slide-left,
  .animate-slide-right,
  .animate-bounce-in,
  .animate-slide-up-enhanced,
  .animate-slide-down-enhanced,
  .animate-slide-left-enhanced,
  .animate-slide-right-enhanced,
  .animate-scale-in-enhanced,
  .animate-stagger>*,
  .animate-stagger-fast>*,
  .animate-stagger-bounce>* {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
    will-change: auto !important;
  }

  /* Ensure immediate visibility for reduced motion users */
  .animate-element,
  .animate-fade-in,
  .animate-slide-up,
  .animate-slide-down,
  .animate-scale-in,
  .animate-slide-left,
  .animate-slide-right,
  .animate-bounce-in,
  .animate-slide-up-enhanced,
  .animate-slide-down-enhanced,
  .animate-slide-left-enhanced,
  .animate-slide-right-enhanced,
  .animate-scale-in-enhanced {
    opacity: 1 !important;
    visibility: visible !important;
  }

  /* Mobile Navigation Reduced Motion */
  .nav-links {
    transition: none !important;
  }

  .nav-overlay {
    transition: none !important;
  }

  .hamburger span {
    transition: none !important;
  }

  .sidebar-nav a {
    transition: none !important;
  }

  .close-btn {
    transition: none !important;
  }
}

/* Animation Delay Utilities */
.animate-delay-100 {
  --animation-delay: 0.1s;
}

.animate-delay-200 {
  --animation-delay: 0.2s;
}

.animate-delay-300 {
  --animation-delay: 0.3s;
}

.animate-delay-400 {
  --animation-delay: 0.4s;
}

.animate-delay-500 {
  --animation-delay: 0.5s;
}

/* Enhanced Animation Duration Utilities */
.animate-duration-fast {
  --animation-duration: var(--animation-duration-fast);
}

.animate-duration-normal {
  --animation-duration: var(--animation-duration-normal);
}

.animate-duration-slow {
  --animation-duration: var(--animation-duration-slow);
}

.animate-duration-300 {
  --animation-duration: 0.3s;
}

.animate-duration-500 {
  --animation-duration: 0.5s;
}

.animate-duration-700 {
  --animation-duration: 0.7s;
}

.animate-duration-900 {
  --animation-duration: 0.9s;
}

.animate-duration-1000 {
  --animation-duration: 1s;
}

.animate-duration-1200 {
  --animation-duration: 1.2s;
}

/* Enhanced Animation Easing Utilities */
.animate-easing-elegant {
  --animation-easing: var(--animation-easing-elegant);
}

.animate-easing-bounce {
  --animation-easing: var(--animation-easing-bounce);
}

.animate-easing-smooth {
  --animation-easing: var(--animation-easing-smooth);
}

/* Premium Animation Combinations */
.animate-premium {
  --animation-duration: var(--animation-duration-slow);
  --animation-easing: var(--animation-easing-elegant);
}

.animate-luxury {
  --animation-duration: var(--animation-duration-normal);
  --animation-easing: var(--animation-easing-elegant);
  --stagger-delay: 200ms;
}

/* Enhanced dropdown animation */
.animate-dropdown {
  opacity: 0;
  transform: translateY(-15px);
  transition: opacity 0.4s var(--animation-easing), transform 0.4s var(--animation-easing);
}

.animate-dropdown.visible,
.animate-dropdown.animate-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== CROSS-BROWSER COMPATIBILITY ENHANCEMENTS ===== */

/* Webkit/Safari specific optimizations */
@supports (-webkit-backdrop-filter: blur(10px)) {

  .animate-element,
  .animate-fade-in,
  .animate-slide-up,
  .animate-slide-down,
  .animate-scale-in,
  .animate-slide-left,
  .animate-slide-right {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }

  .animate-element,
  .animate-fade-in,
  .animate-slide-up,
  .animate-slide-down,
  .animate-scale-in,
  .animate-slide-left,
  .animate-slide-right,
  .animate-stagger>* {
    -webkit-perspective: 1000;
    perspective: 1000;
  }
}

/* 
===== PAGE LOADER COMPONENT ===== */

/* Page Loader Overlay */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--bg) 0%, #f0eae0 50%, var(--bg) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  visibility: visible;
  transition: opacity var(--animation-duration-page-loader) var(--animation-easing-elegant),
    visibility var(--animation-duration-page-loader) var(--animation-easing-elegant);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* Page Loader Hidden State */
.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Page Loader Content Container */
.page-loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 300px;
  padding: 2rem;
}

/* Page Loader Logo Container */
.page-loader-logo {
  position: relative;
  margin-bottom: 2rem;
  animation: pageLoaderPulse var(--animation-duration-page-loader) var(--animation-easing-elegant) infinite;
}

/* Page Loader Logo Image */
.page-loader-logo img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  box-shadow: 0 20px 40px rgba(191, 161, 131, 0.3);
  animation: pageLoaderScale 2s var(--animation-easing-elegant) infinite;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Page Loader Logo Ring Animation */
.page-loader-logo::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  border: 2px solid transparent;
  border-top: 2px solid var(--accent);
  border-radius: 50%;
  animation: pageLoaderSpin 1.5s linear infinite;
  opacity: 0.7;
}

.page-loader-logo::after {
  content: '';
  position: absolute;
  top: -20px;
  left: -20px;
  right: -20px;
  bottom: -20px;
  border: 1px solid transparent;
  border-bottom: 1px solid rgba(191, 161, 131, 0.4);
  border-radius: 50%;
  animation: pageLoaderSpin 2s linear infinite reverse;
  opacity: 0.5;
}

/* Page Loader Text */
.page-loader-text {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 2px;
  margin-bottom: 1rem;
  animation: pageLoaderFadeInUp 1s var(--animation-easing-elegant) 0.5s both;
}

/* Page Loader Subtitle */
.page-loader-subtitle {
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 1px;
  animation: pageLoaderFadeInUp 1s var(--animation-easing-elegant) 0.8s both;
}

/* Page Loader Progress Indicator */
.page-loader-progress {
  width: 200px;
  height: 2px;
  background: rgba(191, 161, 131, 0.2);
  border-radius: 1px;
  margin-top: 2rem;
  overflow: hidden;
  animation: pageLoaderFadeInUp 1s var(--animation-easing-elegant) 1s both;
}

.page-loader-progress::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: pageLoaderProgressSlide 2s var(--animation-easing-smooth) infinite;
}

/* Page Loader Keyframe Animations */
@keyframes pageLoaderPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

@keyframes pageLoaderScale {

  0%,
  100% {
    transform: scale(1) rotate(0deg);
  }

  25% {
    transform: scale(1.1) rotate(2deg);
  }

  50% {
    transform: scale(1.05) rotate(0deg);
  }

  75% {
    transform: scale(1.1) rotate(-2deg);
  }
}

@keyframes pageLoaderSpin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes pageLoaderFadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pageLoaderProgressSlide {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

/* Page Loader Mobile Optimizations */
@media (max-width: 768px) {
  .page-loader-content {
    max-width: 250px;
    padding: 1.5rem;
  }

  .page-loader-logo img {
    width: 100px;
    height: 100px;
  }

  .page-loader-text {
    font-size: 1.3rem;
    letter-spacing: 1.5px;
  }

  .page-loader-subtitle {
    font-size: 0.8rem;
  }

  .page-loader-progress {
    width: 150px;
  }
}

/* Page Loader Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

  .page-loader-logo,
  .page-loader-logo img,
  .page-loader-logo::before,
  .page-loader-logo::after,
  .page-loader-text,
  .page-loader-subtitle,
  .page-loader-progress {
    animation: none !important;
  }

  .page-loader-logo img {
    transform: none !important;
  }

  .page-loader-text,
  .page-loader-subtitle,
  .page-loader-progress {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Page Loader Performance Optimizations */
.page-loader,
.page-loader-logo,
.page-loader-logo img,
.page-loader-logo::before,
.page-loader-logo::after {
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.page-loader.hidden {
  will-change: auto;
}

/* ===
== MOBILE-SPECIFIC ANIMATION OPTIMIZATIONS ===== */

/* Touch-optimized elements */
.touch-optimized {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

/* Mobile performance optimizations */
@media (max-width: 768px) {

  /* Reduce animation complexity on mobile */
  .animate-element,
  .animate-fade-in,
  .animate-slide-up,
  .animate-slide-down,
  .animate-scale-in,
  .animate-slide-left,
  .animate-slide-right,
  .animate-bounce-in,
  .animate-slide-up-enhanced,
  .animate-slide-down-enhanced,
  .animate-slide-left-enhanced,
  .animate-slide-right-enhanced,
  .animate-scale-in-enhanced {
    --animation-duration: var(--animation-duration-fast);
    --stagger-delay: 100ms;
  }

  /* Optimize stagger animations for mobile */
  .animate-stagger>*,
  .animate-stagger-fast>*,
  .animate-stagger-bounce>* {
    --animation-duration: var(--animation-duration-fast);
  }

  /* Simplified easing for better mobile performance */
  .animate-bounce-in,
  .animate-stagger-bounce>* {
    --animation-easing: cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Touch interaction optimizations */
  .btn,
  .card,
  a:not(.btn) {
    transition: transform 0.1s ease-out, box-shadow 0.1s ease-out;
  }

  .btn:active,
  .card:active {
    transform: scale(0.98);
  }

  /* Optimize gallery images for mobile */
  .gallery img {
    --animation-duration: var(--animation-duration-fast);
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
  }

  .gallery img:active {
    transform: scale(0.95);
  }
}

/* Low-end mobile device optimizations */
@media (max-width: 480px) {

  /* Further reduce animation complexity */
  .animate-element,
  .animate-fade-in,
  .animate-slide-up,
  .animate-slide-down,
  .animate-scale-in,
  .animate-slide-left,
  .animate-slide-right,
  .animate-bounce-in,
  .animate-slide-up-enhanced,
  .animate-slide-down-enhanced,
  .animate-slide-left-enhanced,
  .animate-slide-right-enhanced,
  .animate-scale-in-enhanced {
    --animation-duration: 250ms;
    --stagger-delay: 75ms;
    --animation-easing: ease-out;
  }

  /* Minimal stagger delays for low-end devices */
  .animate-stagger>*,
  .animate-stagger-fast>*,
  .animate-stagger-bounce>* {
    --animation-duration: 250ms;
  }
}

/* High-DPI mobile optimizations */
@media (max-width: 768px) and (-webkit-min-device-pixel-ratio: 2) {

  /* Better performance for high-DPI mobile devices */
  .animate-element,
  .animate-fade-in,
  .animate-slide-up,
  .animate-slide-down,
  .animate-scale-in,
  .animate-slide-left,
  .animate-slide-right,
  .animate-bounce-in,
  .animate-slide-up-enhanced,
  .animate-slide-down-enhanced,
  .animate-slide-left-enhanced,
  .animate-slide-right-enhanced,
  .animate-scale-in-enhanced {
    --animation-duration: var(--animation-duration-normal);
    --stagger-delay: 120ms;
  }
}

/* Tablet-specific optimizations */
@media (min-width: 769px) and (max-width: 1024px) {

  .animate-element,
  .animate-fade-in,
  .animate-slide-up,
  .animate-slide-down,
  .animate-scale-in,
  .animate-slide-left,
  .animate-slide-right,
  .animate-bounce-in,
  .animate-slide-up-enhanced,
  .animate-slide-down-enhanced,
  .animate-slide-left-enhanced,
  .animate-slide-right-enhanced,
  .animate-scale-in-enhanced {
    --animation-duration: 500ms;
    --stagger-delay: 120ms;
  }
}

/* Orientation change optimizations */
@media (orientation: landscape) and (max-width: 768px) {

  /* Faster animations in landscape mode for better UX */
  .animate-element,
  .animate-fade-in,
  .animate-slide-up,
  .animate-slide-down,
  .animate-scale-in,
  .animate-slide-left,
  .animate-slide-right,
  .animate-bounce-in,
  .animate-slide-up-enhanced,
  .animate-slide-down-enhanced,
  .animate-slide-left-enhanced,
  .animate-slide-right-enhanced,
  .animate-scale-in-enhanced {
    --animation-duration: var(--animation-duration-fast);
  }
}

/* Connection-aware optimizations */
@media (prefers-reduced-data: reduce) {

  /* Minimal animations for users with data constraints */
  .animate-element,
  .animate-fade-in,
  .animate-slide-up,
  .animate-slide-down,
  .animate-scale-in,
  .animate-slide-left,
  .animate-slide-right,
  .animate-bounce-in,
  .animate-slide-up-enhanced,
  .animate-slide-down-enhanced,
  .animate-slide-left-enhanced,
  .animate-slide-right-enhanced,
  .animate-scale-in-enhanced,
  .animate-stagger>*,
  .animate-stagger-fast>*,
  .animate-stagger-bounce>* {
    --animation-duration: 200ms;
    --stagger-delay: 50ms;
    --animation-easing: ease-out;
  }
}

/* Touch-specific hover states */
@media (hover: none) and (pointer: coarse) {

  /* Remove hover effects on touch devices */
  .btn:hover,
  .card:hover,
  .gallery img:hover {
    transform: none;
    box-shadow: var(--shadow);
  }

  /* Add active states for touch feedback */
  .btn:active {
    transform: scale(0.98);
    box-shadow: 0 5px 15px rgba(191, 161, 131, 0.2);
  }

  .card:active {
    transform: scale(0.99);
  }

  .gallery img:active {
    transform: scale(0.95);
  }
}

/* =
==== ACCESSIBILITY ENHANCEMENTS ===== */

/* Keyboard navigation styles */
.keyboard-navigation *:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.focus-visible *:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Remove focus outline when not using keyboard */
body:not(.keyboard-navigation) *:focus,
body:not(.focus-visible) *:focus {
  outline: none;
}

/* High contrast mode */
.high-contrast {
  --bg: #ffffff;
  --ink: #000000;
  --accent: #0066cc;
  --muted: #333333;
  --white: #ffffff;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.high-contrast .btn {
  border: 2px solid var(--ink);
  font-weight: 700;
}

.high-contrast .card {
  border: 2px solid var(--ink);
}

.high-contrast .badge {
  background: var(--ink);
  color: var(--white);
  border: 1px solid var(--white);
}

/* Screen reader optimizations */
.screen-reader-active .animate-element,
.screen-reader-active .animate-fade-in,
.screen-reader-active .animate-slide-up,
.screen-reader-active .animate-slide-down,
.screen-reader-active .animate-scale-in,
.screen-reader-active .animate-slide-left,
.screen-reader-active .animate-slide-right,
.screen-reader-active .animate-bounce-in,
.screen-reader-active .animate-slide-up-enhanced,
.screen-reader-active .animate-slide-down-enhanced,
.screen-reader-active .animate-slide-left-enhanced,
.screen-reader-active .animate-slide-right-enhanced,
.screen-reader-active .animate-scale-in-enhanced {
  /* Faster animations for screen reader users */
  --animation-duration: var(--animation-duration-fast);
}

/* Reduced data mode */
.reduce-data .page-loader {
  /* Simpler loader for reduced data usage */
  background: var(--bg);
}

.reduce-data .page-loader-logo::before,
.reduce-data .page-loader-logo::after {
  display: none;
}

/* Skip links for keyboard navigation */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--accent);
  color: var(--white);
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 10000;
  font-weight: 600;
}

.skip-link:focus {
  top: 6px;
}

/* Improved focus indicators for interactive elements */
.btn:focus-visible,
.card:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(191, 161, 131, 0.2);
}

/* Enhanced touch targets for accessibility */
@media (max-width: 768px) {

  .btn,
  a,
  button {
    min-height: 44px;
    min-width: 44px;
    padding: 12px 16px;
  }

  .nav-links a {
    min-height: 48px;
    padding: 12px 16px;
  }
}

/* Motion-safe animations */
@media (prefers-reduced-motion: no-preference) {

  /* Only apply complex animations when motion is preferred */
  .animate-bounce-in {
    animation: bounceIn var(--animation-duration) var(--animation-easing-bounce);
  }

  .animate-stagger-bounce>* {
    animation: bounceInStagger var(--animation-duration) var(--animation-easing-bounce);
  }
}

/* Color contrast improvements */
@media (prefers-contrast: high) {
  :root {
    --bg: #ffffff;
    --ink: #000000;
    --accent: #0066cc;
    --muted: #333333;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  }

  .btn {
    border: 2px solid var(--ink);
    font-weight: 700;
  }

  .card {
    border: 2px solid var(--ink);
  }
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Ensure sufficient color contrast for text */
.badge {
  font-weight: 600;
  border: 1px solid rgba(191, 161, 131, 0.3);
}

/* Improve link visibility */
a:not(.btn) {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:not(.btn):hover {
  text-decoration-thickness: 2px;
}

/* Remove underlines from navigation links */
.nav-links a:not(.btn),
.sidebar-nav a:not(.btn) {
  text-decoration: none;
}

.nav-links a:not(.btn):hover,
.sidebar-nav a:not(.btn):hover {
  text-decoration: none;
}

/* Remove underlines from brand links */
.brand,
.footer .brand {
  text-decoration: none !important;
}

.brand:hover,
.footer .brand:hover {
  text-decoration: none !important;
}

/* Ensure GitHub link has no underline */
.github-link {
  text-decoration: none !important;
}

.github-link:hover {
  text-decoration: none !important;
}

/* Focus management for dynamic content */
[aria-live] {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Ensure interactive elements are properly labeled */
button:not([aria-label]):not([aria-labelledby]):empty::after,
.btn:not([aria-label]):not([aria-labelledby]):empty::after {
  content: "Button";
  position: absolute;
  left: -10000px;
}

/* Improve form accessibility */
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(191, 161, 131, 0.2);
}

/* ===== PRE
MIUM HOVER ANIMATIONS ===== */

/* Enhanced button hover effects */
.btn {
  position: relative;
  overflow: hidden;
  transition: all var(--animation-duration-normal) var(--animation-easing-elegant);
  transform: translateY(0);
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left var(--animation-duration-slow) var(--animation-easing-elegant);
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 25px rgba(191, 161, 131, 0.4);
}

.btn:active {
  transform: translateY(-1px);
  transition-duration: var(--animation-duration-fast);
}

/* Enhanced navigation link hover effects */
.nav-links a:not(.btn) {
  position: relative;
  transition: all var(--animation-duration-normal) var(--animation-easing-elegant);
}

.nav-links a:not(.btn)::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: all var(--animation-duration-normal) var(--animation-easing-elegant);
  transform: translateX(-50%);
}

.nav-links a:not(.btn):hover::after {
  width: 100%;
}

.nav-links a:not(.btn):hover {
  color: var(--accent);
  transform: translateY(-1px);
}

/* Enhanced card hover effects */
.card {
  transition: all var(--animation-duration-normal) var(--animation-easing-elegant);
  transform: translateY(0);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.card:hover .badge {
  transform: scale(1.05);
  background: var(--accent);
  color: var(--white);
}

/* Service item hover effects */
.service-item {
  position: relative;
  overflow: hidden;
}

.service-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(191, 161, 131, 0.05), rgba(191, 161, 131, 0.1));
  opacity: 0;
  transition: opacity var(--animation-duration-normal) var(--animation-easing-elegant);
}

.service-item:hover::before {
  opacity: 1;
}

.service-item:hover h3 {
  color: var(--accent);
  transform: translateX(5px);
  transition: all var(--animation-duration-normal) var(--animation-easing-elegant);
}

/* Gallery image hover effects */
.gallery img {
  transition: all var(--animation-duration-normal) var(--animation-easing-elegant);
  filter: brightness(1) saturate(1);
}

.gallery img:hover {
  transform: scale(1.05) rotate(1deg);
  filter: brightness(1.1) saturate(1.2);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  z-index: 10;
  position: relative;
}

/* Brand logo hover effects */
.brand {
  transition: all var(--animation-duration-normal) var(--animation-easing-elegant);
}

.brand:hover {
  transform: scale(1.05);
}

.brand img {
  transition: all var(--animation-duration-normal) var(--animation-easing-elegant);
}

.brand:hover img {
  transform: rotate(5deg);
  box-shadow: 0 8px 20px rgba(191, 161, 131, 0.3);
}

/* Footer brand hover effects */
.footer .brand:hover {
  transform: scale(1.02);
}

.footer .brand:hover img {
  transform: rotate(3deg);
}

/* GitHub link hover effects */
.github-link {
  position: relative;
  transition: all var(--animation-duration-normal) var(--animation-easing-elegant);
}

.github-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(64, 120, 192, 0.1);
  border-radius: 4px;
  opacity: 0;
  transform: scale(0.8);
  transition: all var(--animation-duration-normal) var(--animation-easing-elegant);
}

.github-link:hover::before {
  opacity: 1;
  transform: scale(1);
}

.github-link:hover {
  transform: translateY(-2px);
}

.github-link:hover i {
  transform: rotate(360deg);
  transition: transform var(--animation-duration-slow) var(--animation-easing-bounce);
}

/* Form input hover and focus effects */
input:not([type="submit"]):not([type="button"]),
textarea,
select {
  transition: all var(--animation-duration-normal) var(--animation-easing-elegant);
  position: relative;
}

input:not([type="submit"]):not([type="button"]):hover,
textarea:hover,
select:hover {
  border-color: rgba(191, 161, 131, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(191, 161, 131, 0.2);
}

input:not([type="submit"]):not([type="button"]):focus,
textarea:focus,
select:focus {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(191, 161, 131, 0.3);
}

/* Badge hover effects */
.badge {
  transition: all var(--animation-duration-normal) var(--animation-easing-elegant);
  cursor: default;
}

.badge:hover {
  transform: scale(1.1);
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(191, 161, 131, 0.4);
}

/* Link hover effects with elegant underline animation */
a:not(.btn):not(.brand):not(.github-link):not(.nav-links a) {
  position: relative;
  transition: color var(--animation-duration-normal) var(--animation-easing-elegant);
}

a:not(.btn):not(.brand):not(.github-link):not(.nav-links a):hover {
  color: var(--accent);
}

/* Subtle hover effect for the page loader (when visible) */
.page-loader-logo:hover img {
  transform: scale(1.1) rotate(5deg);
  transition: transform var(--animation-duration-normal) var(--animation-easing-bounce);
}

/* Hero section button group hover effects */
.hero .flex .btn:first-child:hover~.btn {
  transform: translateX(5px);
}

.hero .flex .btn:last-child:hover {
  transform: translateX(-5px);
}

/* Staggered hover effects for grid items */
.grid:hover .card:not(:hover) {
  opacity: 0.7;
  transform: scale(0.98);
}

.grid .card:hover {
  z-index: 10;
  position: relative;
}

/* Split section hover effects */
.split>div {
  transition: transform var(--animation-duration-normal) var(--animation-easing-elegant);
}

.split:hover>div:not(:hover) {
  opacity: 0.8;
}

.split>div:hover {
  transform: scale(1.02);
}

/* Responsive hover effects - disable complex hovers on touch devices */
@media (hover: none) and (pointer: coarse) {

  /* Simplify hover effects for touch devices */
  .btn:hover::before,
  .nav-links a:not(.btn)::after,
  .service-item::before,
  .github-link::before {
    display: none;
  }

  .btn:hover {
    transform: none;
    box-shadow: var(--shadow);
  }

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

  .gallery img:hover {
    transform: none;
    filter: none;
  }

  /* Use active states instead for touch feedback */
  .btn:active {
    transform: scale(0.98);
  }

  .card:active {
    transform: scale(0.99);
  }
}

/* Reduced motion hover effects */
@media (prefers-reduced-motion: reduce) {

  .btn,
  .card,
  .nav-links a,
  .brand,
  .gallery img,
  .service-item,
  input,
  textarea,
  select,
  .badge,
  a {
    transition: none !important;
  }

  .btn:hover,
  .card:hover,
  .gallery img:hover,
  .brand:hover {
    transform: none !important;
  }

  .btn::before,
  .nav-links a::after,
  .service-item::before,
  .github-link::before {
    display: none !important;
  }
}

/* High contrast mode hover adjustments */
.high-contrast .btn:hover {
  background: var(--ink);
  color: var(--white);
  border-color: var(--white);
}

.high-contrast .nav-links a:hover {
  background: rgba(0, 0, 0, 0.1);
}

.high-contrast .card:hover {
  border-color: var(--accent);
  border-width: 3px;
}

/* 
===== ENHANCED MOBILE TOUCH INTERACTIONS ===== */

/* Touch feedback animations */
@media (max-width: 768px) {

  /* Enhanced touch targets */
  .btn,
  .nav-links a,
  .card,
  .gallery img,
  .brand,
  a:not(.btn) {
    -webkit-tap-highlight-color: rgba(191, 161, 131, 0.3);
    tap-highlight-color: rgba(191, 161, 131, 0.3);
  }

  /* Button touch interactions */
  .btn {
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .btn:active {
    transform: scale(0.96);
    box-shadow: 0 4px 12px rgba(191, 161, 131, 0.4);
    background: #a88b6f;
  }

  /* Card touch interactions */
  .card {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .card:active {
    transform: scale(0.98);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  }

  /* Navigation link touch feedback */
  .nav-links a:not(.btn) {
    transition: all 0.15s ease-out;
    border-radius: 8px;
    margin: 2px;
  }

  .nav-links a:not(.btn):active {
    background: rgba(191, 161, 131, 0.2);
    transform: scale(0.95);
  }

  /* Gallery image touch interactions */
  .gallery img {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .gallery img:active {
    transform: scale(0.94);
    filter: brightness(0.9);
  }

  /* Brand logo touch feedback */
  .brand:active {
    transform: scale(0.95);
  }

  .brand:active img {
    transform: scale(0.9);
  }

  /* Service item touch interactions */
  .service-item:active {
    transform: scale(0.98);
    background: rgba(191, 161, 131, 0.05);
  }

  /* Badge touch feedback */
  .badge:active {
    transform: scale(0.9);
    background: var(--accent);
    color: var(--white);
  }

  /* Form input touch interactions */
  input:not([type="submit"]):not([type="button"]):active,
  textarea:active,
  select:active {
    transform: scale(1.02);
    border-color: var(--accent);
  }

  /* Enhanced ripple effect for buttons */
  .btn {
    position: relative;
    overflow: hidden;
  }

  .btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
  }

  .btn:active::after {
    width: 300px;
    height: 300px;
  }
}

/* Touch-specific scroll animations */
@media (max-width: 768px) {

  /* Faster scroll-triggered animations for mobile */
  .animate-element,
  .animate-fade-in,
  .animate-slide-up,
  .animate-slide-down,
  .animate-scale-in,
  .animate-slide-left,
  .animate-slide-right,
  .animate-bounce-in,
  .animate-slide-up-enhanced,
  .animate-slide-down-enhanced,
  .animate-slide-left-enhanced,
  .animate-slide-right-enhanced,
  .animate-scale-in-enhanced {
    --animation-duration: 400ms;
    --animation-easing: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }

  /* Reduced stagger delays for better mobile performance */
  .animate-stagger>*,
  .animate-stagger-fast>*,
  .animate-stagger-bounce>* {
    --stagger-delay: 100ms;
  }

  /* Mobile-optimized intersection observer thresholds */
  .animate-element {
    --animation-viewport-threshold: 0.15;
  }
}

/* Swipe gesture indicators */
@media (max-width: 768px) {
  .gallery {
    position: relative;
  }

  .gallery::before {
    /* content: '← Swipe to explore →'; */
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: var(--muted);
    opacity: 0.7;
    pointer-events: none;
  }

  /* Swipe animation for gallery images */
  .gallery img {
    transform-origin: center;
  }

  .gallery img.swiping-left {
    transform: translateX(-20px) rotate(-2deg);
    opacity: 0.8;
  }

  .gallery img.swiping-right {
    transform: translateX(20px) rotate(2deg);
    opacity: 0.8;
  }
}

/* Touch-optimized navigation */
@media (max-width: 768px) {

  /* Enhanced mobile navigation */
  .nav-links {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  .nav-links a {
    position: relative;
    overflow: hidden;
  }

  .nav-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(191, 161, 131, 0.2), transparent);
    transition: left 0.5s ease;
  }

  .nav-links a:active::before {
    left: 100%;
  }

  /* Improved touch targets */
  .nav-links a,
  .btn {
    min-height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Pull-to-refresh indicator (visual only) */
@media (max-width: 768px) {
  body::before {
    content: '';
    position: fixed;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    border: 2px solid var(--accent);
    border-top: 2px solid transparent;
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 9999;
  }

  body.pull-to-refresh::before {
    top: 20px;
    opacity: 1;
    animation: spin 1s linear infinite;
  }
}

@keyframes spin {
  0% {
    transform: translateX(-50%) rotate(0deg);
  }

  100% {
    transform: translateX(-50%) rotate(360deg);
  }
}

/* Touch-specific loading states */
@media (max-width: 768px) {
  .btn.loading {
    pointer-events: none;
    opacity: 0.7;
  }

  .btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: spin 1s linear infinite;
  }

  .card.loading {
    opacity: 0.6;
    pointer-events: none;
  }

  .card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(191, 161, 131, 0.3);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: spin 1s linear infinite;
  }
}

/* Haptic feedback simulation through visual cues */
@media (max-width: 768px) {

  .btn:active,
  .card:active,
  .nav-links a:active {
    animation: haptic-pulse 0.1s ease-out;
  }
}

@keyframes haptic-pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(0.98);
  }

  100% {
    transform: scale(1);
  }
}

/* Touch-optimized form interactions */
@media (max-width: 768px) {

  input:not([type="submit"]):not([type="button"]),
  textarea,
  select {
    font-size: 16px;
    /* Prevents zoom on iOS */
    transition: all 0.2s ease;
  }

  input:not([type="submit"]):not([type="button"]):focus,
  textarea:focus,
  select:focus {
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(191, 161, 131, 0.3);
  }

  /* Enhanced touch feedback for form submission */
  input[type="submit"],
  button[type="submit"] {
    transition: all 0.15s ease;
  }

  input[type="submit"]:active,
  button[type="submit"]:active {
    transform: scale(0.96);
    background: #a88b6f;
  }

  /* Center align send button on mobile only */
  .mobile-center-btn {
    text-align: center;
    margin-top: 1rem;
  }

  .mobile-center-btn .btn.btn-accent.mt-2 {
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: fit-content;
    /* Fix mobile double-tap issue */
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    -webkit-touch-callout: none;
    user-select: none;
    /* Remove animations for better mobile performance */
    transition: none !important;
    animation: none !important;
  }

  /* Disable hover effects on touch devices to prevent double-tap */
  @media (hover: none) and (pointer: coarse) {
    .mobile-center-btn .btn.btn-accent.mt-2:hover {
      background: var(--accent) !important;
      transform: none !important;
      box-shadow: none !important;
    }
  }

  /* Remove all animations and effects for mobile reliability */
  .mobile-center-btn .btn.btn-accent.mt-2:active,
  .mobile-center-btn .btn.btn-accent.mt-2:focus {
    transform: none !important;
    background: var(--accent) !important;
    transition: none !important;
    animation: none !important;
    box-shadow: none !important;
  }

  /* Ensure no inherited animations affect the button */
  .mobile-center-btn .btn.btn-accent.mt-2,
  .mobile-center-btn .btn.btn-accent.mt-2:before,
  .mobile-center-btn .btn.btn-accent.mt-2:after {
    animation-duration: 0s !important;
    transition-duration: 0s !important;
  }

  /* REMOVE ALL BUTTON ANIMATIONS ON MOBILE - Fix Safari double-tap issue */
  .btn,
  .btn:hover,
  .btn:active,
  .btn:focus,
  .btn-accent,
  .btn-accent:hover,
  .btn-accent:active,
  .btn-accent:focus,
  .btn-outline,
  .btn-outline:hover,
  .btn-outline:active,
  .btn-outline:focus,
  button,
  button:hover,
  button:active,
  button:focus {
    transition: none !important;
    animation: none !important;
    transform: none !important;
    box-shadow: none !important;
    -webkit-transition: none !important;
    -webkit-animation: none !important;
    -webkit-transform: none !important;
  }

  /* Disable hover effects completely on mobile */
  @media (hover: none) and (pointer: coarse) {

    .btn:hover,
    .btn-accent:hover,
    .btn-outline:hover,
    button:hover {
      background: var(--accent) !important;
      color: var(--white) !important;
      transform: none !important;
      box-shadow: none !important;
    }
  }

  /* SAFARI SPECIFIC FIXES - Aggressive touch optimization */
  .btn,
  .btn-accent,
  .btn-outline,
  button {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    touch-action: manipulation !important;
    pointer-events: auto !important;
    cursor: pointer !important;
  }

}

/* Orientation change animations */
@media (max-width: 768px) {
  @media (orientation: landscape) {
    .hero .content {
      animation: orientation-adjust 0.3s ease-out;
    }

    .nav-links {
      animation: nav-reflow 0.3s ease-out;
    }
  }

  @media (orientation: portrait) {
    .hero .content {
      animation: orientation-adjust 0.3s ease-out;
    }

    .gallery {
      animation: gallery-reflow 0.3s ease-out;
    }
  }
}

@keyframes orientation-adjust {
  0% {
    opacity: 0.8;
    transform: scale(0.98);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes nav-reflow {
  0% {
    transform: translateY(-10px);
    opacity: 0.8;
  }

  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes gallery-reflow {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Touch-specific accessibility enhancements */
@media (max-width: 768px) {

  /* Larger focus indicators for touch */
  .keyboard-navigation *:focus,
  .focus-visible *:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
  }

  /* Enhanced touch feedback for accessibility */
  [aria-pressed="true"],
  [aria-selected="true"] {
    background: rgba(191, 161, 131, 0.2);
    transform: scale(0.98);
  }

  /* Touch-friendly skip links */
  .skip-link:focus {
    top: 10px;
    padding: 12px 16px;
    font-size: 16px;
  }
}

/* Performance optimizations for touch devices */
@media (max-width: 768px) {
  /* Reduce animation complexity on lower-end devices */
  @media (max-device-width: 480px) {

    .btn::after,
    .nav-links a::before,
    .service-item::before {
      display: none;
    }

    .btn:active,
    .card:active,
    .gallery img:active {
      transition-duration: 0.1s;
    }
  }

  /* Optimize for devices with limited memory */
  @media (max-device-width: 480px) and (max-device-height: 800px) {

    .animate-element,
    .animate-fade-in,
    .animate-slide-up,
    .animate-slide-down,
    .animate-scale-in,
    .animate-slide-left,
    .animate-slide-right,
    .animate-bounce-in {
      --animation-duration: 250ms;
      --animation-easing: ease-out;
    }
  }
}

/*
 ===== BROWSER COMPATIBILITY FALLBACKS ===== */

/* CSS-only animation fallbacks for JavaScript-disabled browsers */
.no-js .animate-element,
.no-js .animate-fade-in,
.no-js .animate-slide-up,
.no-js .animate-slide-down,
.no-js .animate-scale-in,
.no-js .animate-slide-left,
.no-js .animate-slide-right,
.no-js .animate-bounce-in,
.no-js [class*="animate-"] {
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
}

.no-js .page-loader {
  display: none !important;
}

/* Old browser fallbacks */
.old-browser .animate-element,
.old-browser .animate-fade-in,
.old-browser .animate-slide-up,
.old-browser .animate-slide-down,
.old-browser .animate-scale-in,
.old-browser .animate-slide-left,
.old-browser .animate-slide-right,
.old-browser .animate-bounce-in,
.old-browser [class*="animate-"] {
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
  animation: none !important;
  transition: none !important;
}

/* Internet Explorer specific fallbacks */
.browser-ie .page-loader {
  display: none !important;
}

.browser-ie .animate-element,
.browser-ie [class*="animate-"] {
  opacity: 1 !important;
  filter: none !important;
}

/* Safari specific optimizations */
.browser-safari .animate-element,
.browser-safari [class*="animate-"] {
  -webkit-backface-visibility: hidden;
  -webkit-transform: translateZ(0);
}

/* Firefox specific optimizations */
.browser-firefox .page-loader {
  backdrop-filter: none;
  /* Firefox has issues with backdrop-filter */
}

/* Chrome specific optimizations */
.browser-chrome .animate-element,
.browser-chrome [class*="animate-"] {
  will-change: transform, opacity;
}

/* Edge specific optimizations */
.browser-edge .animate-element,
.browser-edge [class*="animate-"] {
  -ms-transform: translateZ(0);
}

/* Fallback for browsers without CSS custom properties */
@supports not (color: var(--test)) {

  :root,
  * {
    --bg: #e8e2d8;
    --ink: #121212;
    --accent: #bfa183;
    --muted: #6f655a;
    --white: #ffffff;
    --animation-duration: 0.6s;
    --animation-easing: cubic-bezier(0.4, 0, 0.2, 1);
    --animation-distance: 30px;
    --stagger-delay: 150ms;
  }

  .animate-element {
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
      transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .btn {
    background: #bfa183;
    color: #ffffff;
  }

  .btn:hover {
    background: #a88b6f;
  }
}

/* Fallback for browsers without CSS Grid */
@supports not (display: grid) {

  .grid,
  .grid-2,
  .grid-3 {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -ms-flex-direction: row;
    flex-direction: row;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .grid>*,
  .grid-2>*,
  .grid-3>* {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    min-width: 250px;
  }

  .split {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    gap: 2rem;
  }

  @media (min-width: 768px) {
    .split {
      -webkit-box-orient: horizontal;
      -webkit-box-direction: normal;
      -ms-flex-direction: row;
      flex-direction: row;
    }
  }
}

/* Fallback for browsers without Flexbox */
@supports not (display: flex) {
  .flex {
    display: block;
    text-align: center;
  }

  .flex>* {
    display: inline-block;
    margin: 0.5rem;
    vertical-align: top;
  }

  .brand {
    display: block;
  }

  .brand img {
    display: inline-block;
    vertical-align: middle;
  }

  .brand span {
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.5rem;
  }

  .nav-links {
    display: block;
  }

  .nav-links a {
    display: inline-block;
    margin: 0.25rem;
  }
}

/* Fallback for browsers without CSS transforms */
@supports not (transform: translateY(0)) {

  .animate-element,
  .animate-fade-in,
  .animate-slide-up,
  .animate-slide-down,
  .animate-scale-in,
  .animate-slide-left,
  .animate-slide-right,
  .animate-bounce-in,
  [class*="animate-"] {
    opacity: 0;
    transition: opacity 0.6s ease;
  }

  .animate-element.animate-visible,
  .animate-fade-in.animate-visible,
  .animate-slide-up.animate-visible,
  .animate-slide-down.animate-visible,
  .animate-scale-in.animate-visible,
  .animate-slide-left.animate-visible,
  .animate-slide-right.animate-visible,
  .animate-bounce-in.animate-visible,
  [class*="animate-"].animate-visible {
    opacity: 1;
  }

  .btn:hover,
  .card:hover {
    transform: none;
  }
}

/* Fallback for browsers without CSS transitions */
@supports not (transition: opacity 1s) {

  .animate-element,
  .animate-fade-in,
  .animate-slide-up,
  .animate-slide-down,
  .animate-scale-in,
  .animate-slide-left,
  .animate-slide-right,
  .animate-bounce-in,
  [class*="animate-"],
  .btn,
  .card,
  .nav-links a {
    transition: none !important;
  }

  .animate-element.animate-visible,
  [class*="animate-"].animate-visible {
    opacity: 1 !important;
  }
}

/* Print media fallbacks */
@media print {

  .page-loader,
  .nav-links,
  .footer {
    display: none !important;
  }

  .animate-element,
  [class*="animate-"] {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }

  .btn {
    border: 2px solid #000;
    background: transparent !important;
    color: #000 !important;
  }
}

/* High contrast mode fallbacks */
@media (prefers-contrast: high),
(-ms-high-contrast: active) {
  .page-loader {
    background: #ffffff;
    color: #000000;
  }

  .page-loader-text,
  .page-loader-subtitle {
    color: #000000;
  }

  .btn {
    border: 2px solid #000000;
    background: #ffffff;
    color: #000000;
  }

  .btn:hover {
    background: #000000;
    color: #ffffff;
  }

  .card {
    border: 2px solid #000000;
  }
}

/* Reduced data fallbacks */
@media (prefers-reduced-data: reduce) {

  .page-loader-logo::before,
  .page-loader-logo::after {
    display: none;
  }

  .animate-element,
  [class*="animate-"] {
    --animation-duration: 200ms;
    --stagger-delay: 50ms;
  }

  .btn::before,
  .nav-links a::after,
  .service-item::before {
    display: none;
  }
}

/* ===== 
PREMIUM HOVER ANIMATIONS ===== */

/* Button Hover Effects */
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
  transition-duration: calc(var(--animation-duration-hover) * 0.5);
}

/* Navigation Link Hover Effects */
.nav-links a:hover {
  transform: translateY(-1px);
  transition: all var(--animation-duration-hover) var(--animation-easing-luxury);
}

/* Service Card Hover Effects */
.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
  transition: all var(--animation-duration-hover) var(--animation-easing-luxury);
}

/* Gallery Image Hover Effects */
.gallery-item:hover img {
  transform: scale(1.05);
  transition: transform var(--animation-duration-hover) var(--animation-easing-luxury);
}

/* Interactive Element Hover Effects */
.interactive-element:hover {
  transform: scale(1.02);
  transition: transform var(--animation-duration-hover) var(--animation-easing-premium);
}

/* Brand Logo Hover Effect */
.brand:hover img {
  transform: rotate(5deg) scale(1.05);
  transition: transform var(--animation-duration-hover) var(--animation-easing-bounce);
}

/* Form Input Focus Effects */
input:focus,
textarea:focus,
select:focus {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(191, 161, 131, 0.2);
  transition: all var(--animation-duration-hover) var(--animation-easing-luxury);
}

/* Touch Feedback for Mobile */
@media (hover: none) and (pointer: coarse) {
  .btn:active {
    transform: scale(0.98);
    transition: transform 150ms var(--animation-easing-smooth);
  }

  .nav-links a:active {
    transform: scale(0.95);
    transition: transform 150ms var(--animation-easing-smooth);
  }
}

/* ===== FINE-TUNED STAGGER TIMING ===== */

/* Optimized stagger delays for natural visual flow */
.animate-stagger.animate-visible>*:nth-child(1) {
  transition-delay: 0ms;
}

.animate-stagger.animate-visible>*:nth-child(2) {
  transition-delay: 150ms;
}

.animate-stagger.animate-visible>*:nth-child(3) {
  transition-delay: 300ms;
}

.animate-stagger.animate-visible>*:nth-child(4) {
  transition-delay: 450ms;
}

.animate-stagger.animate-visible>*:nth-child(5) {
  transition-delay: 600ms;
}

.animate-stagger.animate-visible>*:nth-child(6) {
  transition-delay: 750ms;
}

.animate-stagger.animate-visible>*:nth-child(7) {
  transition-delay: 900ms;
}

.animate-stagger.animate-visible>*:nth-child(8) {
  transition-delay: 1050ms;
}

/* Premium easing for different element types */
.hero .animate-element {
  transition-timing-function: var(--animation-easing-luxury);
}

.service-card.animate-element {
  transition-timing-function: var(--animation-easing-premium);
}

.gallery-item.animate-element {
  transition-timing-function: var(--animation-easing-elegant);
}