:root {
    /* Define base sizes that scale */
    --flyer-width: 500px;
    --flyer-height: 720px;
    --dodge-distance: 450px; /* How far it swings left */
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    :root {
        --flyer-width: 80vw; /* Use 80% of screen width */
        --flyer-height: calc(80vw * 1.44); /* Maintain aspect ratio (720/500 = 1.44) */
        --dodge-distance: 60vw;
    }
}

body,
html {
  height: 100%;
  margin: 0;
  /* Gradient: Gold at bottom, White middle, Blue top */
  background: linear-gradient(0deg, #deb78a 0%, #ffffff 50%, #80b5c5 100%);
  background-attachment: fixed;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  overflow-x: hidden;
  /* Prevents overflow during animation */
}

.logo-container {
  /* padding-top: 50px; */
  text-align: center;
}

/* Ensure Logo scales too */
.logo-img {
    max-width: 90%; /* Logo won't exceed screen width */
    height: auto;
}

/* --- 3D Flyer "Orbit Swap" (Both Ways) --- */

.flyer-scene {
    perspective: 2500px;
    margin: 20px 0;
    width: 100%;
    display: flex;
    justify-content: center;
    overflow: visible; /* Important for the 3D swing */
}

.flyer-wrapper {
    position: relative;
    width: var(--flyer-width);
    height: var(--flyer-height);
    transform-style: preserve-3d;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.flyer {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation-duration: 1.2s;
    animation-fill-mode: forwards;
    animation-timing-function: cubic-bezier(0.45, 0, 0.55, 1);
}

.flyer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- THE KEYFRAMES --- */

/* FRONT CARD: Forward (Dodge Left to Back) */
@keyframes frontDodgeForward {
    0% { transform: translateZ(100px) translateX(-50px) rotateY(-5deg); z-index: 10; }
    40% { transform: translateZ(100px) translateX(calc(-1 * var(--dodge-distance))) rotateY(-15deg); z-index: 10; } 
    60% { transform: translateZ(-100px) translateX(calc(-1 * var(--dodge-distance))) rotateY(-15deg); z-index: 5; } 
    100% { transform: translateZ(-100px) translateX(50px) rotateY(10deg); z-index: 5; } 
}

/* FRONT CARD: Reverse (Dodge Left to Front) */
@keyframes frontDodgeReverse {
    0% { transform: translateZ(-100px) translateX(50px) rotateY(10deg); z-index: 5; }
    40% { transform: translateZ(-100px) translateX(calc(-1 * var(--dodge-distance))) rotateY(-15deg); z-index: 5; }
    60% { transform: translateZ(100px) translateX(calc(-1 * var(--dodge-distance))) rotateY(-15deg); z-index: 10; }
    100% { transform: translateZ(100px) translateX(-50px) rotateY(-5deg); z-index: 10; }
}

/* BACK CARD: Forward (Move to Front) */
@keyframes backForward {
  0% {
    transform: translateZ(-100px) translateX(200px) rotateY(20deg);
    z-index: 5;
    filter: brightness(0.8);
  }

  100% {
    transform: translateZ(50px) rotateY(5deg) translateX(20px);
    z-index: 10;
    filter: brightness(1);
  }
}

/* BACK CARD: Reverse (Move to Back) */
@keyframes backReverse {
  0% {
    transform: translateZ(50px) rotateY(5deg) translateX(20px);
    z-index: 10;
    filter: brightness(1);
  }

  100% {
    transform: translateZ(-100px) translateX(200px) rotateY(20deg);
    z-index: 5;
    filter: brightness(0.8);
  }
}

/* --- THE CLICK LOGIC --- */

/* When the wrapper has the 'active' class (after a click) */
.flyer-wrapper.active .flyer-front {
    animation-name: frontDodgeForward;
}

.flyer-wrapper.active .flyer-back {
    animation-name: backForward;
}

/* Default State (Reverse animations) */
.flyer-front {
    animation: frontDodgeReverse 1.2s forwards cubic-bezier(0.45, 0, 0.55, 1);
}

.flyer-back {
    animation: backReverse 1.2s forwards cubic-bezier(0.45, 0, 0.55, 1);
}

/* Add a pointer cursor so people know they can click it */
.flyer-wrapper {
    cursor: pointer;
}

/* --- Action Button --- */
.contact-btn {
  background-color: #80b5c5;
  border: none;
  color: white;
  padding: 12px 35px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.contact-btn:hover {
  background-color: #deb78a;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  color: white;
}

/* --- Graceful Fade/Reveal Animation --- */

/* 1. Base State (The Wrapper) */
#phoneFieldWrapper {
    /* Required to create a 'layer' in 3D space for smooth animation */
    will-change: opacity, max-height; 
    overflow: hidden; /* Important so content is clipped during reveal */
    
    /* Cubic Bezier creates a slightly elastic, smooth feel */
    transition: all 2.0s cubic-bezier(0.23, 1, 0.32, 1);
}

/* 2. Hidden State */
.phone-wrapper-hidden {
    opacity: 0;
    max-height: 0px; /* Collapses the height completely */
    margin-bottom: 0px !important; /* Overrides Bootstrap's margin temporarily */
    visibility: hidden; /* Prevents users from clicking the field while hidden */
}

/* 3. Visible State */
.phone-wrapper-visible {
    opacity: 1;
    max-height: 100px; /* Expands to fit the field (adjust if needed) */
    visibility: visible;
}

/* Map CSS */
#areaList.collapse {
    transition: all 0.35s ease-in-out;
}
.extra-small {
    font-size: 0.75rem;
}