/* =====================================================
   OTIUM CREATIONS - ANIMATIONS & INTERACTIONS STYLESHEET
   Atlas Website - Micro-Interactions and Accessibility
   ===================================================== */

/* =====================================================
   SCROLL-TRIGGERED ANIMATIONS
   ===================================================== */

/* Fade In Up */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-up.animate {
  opacity: 1;
  transform: translateY(0);
}

/* Show content immediately if animations aren't loaded yet */
.fade-in-up:not(.animate) {
  animation: showContent 0.1s ease-out 2s forwards;
}

@keyframes showContent {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Left */
.fade-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-left.animate {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-left:not(.animate) {
  animation: showContentLeft 0.1s ease-out 2s forwards;
}

@keyframes showContentLeft {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade In Right */
.fade-in-right {
  opacity: 0;
  transform: translateX(30px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-right.animate {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right:not(.animate) {
  animation: showContentRight 0.1s ease-out 2s forwards;
}

@keyframes showContentRight {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale In */
.scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.scale-in:not(.animate) {
  animation: showContentScale 0.1s ease-out 2s forwards;
}

@keyframes showContentScale {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* =====================================================
   HOVER EFFECTS
   ===================================================== */

/* Lift Effect */
.hover-lift {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(178, 189, 163, 0.2);
}

/* Glow Effect */
.hover-glow {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.hover-glow::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 0.6s ease;
}

.hover-glow:hover::before {
  left: 100%;
}

/* Magnetic Cursor Effect */
.magnetic {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* =====================================================
   PARALLAX & SECTION TRANSITIONS
   ===================================================== */

/* Parallax Elements */
.parallax-element {
  transform: translateY(0);
  transition: transform 0.1s linear;
}

/* Smooth Section Transitions */
section {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* =====================================================
   NAVIGATION ANIMATIONS
   ===================================================== */

nav a {
  position: relative;
  overflow: hidden;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(135deg, var(--sage), var(--peach));
  transition: width 0.3s ease;
}

nav a:hover::after {
  width: 100%;
}

/* =====================================================
   CARD INTERACTIONS
   ===================================================== */

.interactive-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.interactive-card:hover {
  transform: translateY(-8px) rotateX(5deg);
  box-shadow: 0 20px 40px rgba(178, 189, 163, 0.25);
}

/* =====================================================
   STAGGER ANIMATIONS
   ===================================================== */

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* =====================================================
   KEYFRAME ANIMATIONS
   ===================================================== */

@keyframes slideInFromBottom {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* =====================================================
   PAGE TRANSITIONS
   ===================================================== */

.page-transition {
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
}

.page-transition.fade-out {
  opacity: 0;
}

/* =====================================================
   ACCESSIBILITY - FOCUS INDICATORS
   ===================================================== */

/* Default Focus - NO OUTLINES (per design requirements) */
*:focus {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}

button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none !important;
  box-shadow: none !important;
}

.btn:focus,
.cta-button:focus {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}

/* =====================================================
   ACCESSIBILITY - COLOR CONTRAST
   ===================================================== */

.high-contrast {
  color: #2d3748;
  background-color: #ffffff;
}

/* =====================================================
   ACCESSIBILITY - REDUCED MOTION
   ===================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .parallax-element {
    transform: none !important;
  }
  
  .fade-in-up,
  .fade-in-left,
  .fade-in-right,
  .scale-in {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* =====================================================
   ACCESSIBILITY - SCREEN READER UTILITIES
   ===================================================== */

/* Screen Reader Only Text */
.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;
}

/* Visible When Focused for Screen Readers */
.sr-only:focus {
  position: static;
  width: auto;
  height: auto;
  padding: inherit;
  margin: inherit;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* =====================================================
   ACCESSIBILITY - BUTTON STATES
   ===================================================== */

button:disabled,
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

button[aria-pressed="true"] {
  background-color: var(--sage);
  color: white;
}

/* =====================================================
   ACCESSIBILITY - LIVE REGIONS
   ===================================================== */

.live-region {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* =====================================================
   ACCESSIBILITY - FORM STATES
   ===================================================== */

input:invalid {
  border-color: #e53e3e;
  box-shadow: 0 0 0 1px #e53e3e;
}

input:valid {
  border-color: #38a169;
}

/* Error Message Styling */
.error-message {
  color: #e53e3e;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
}

.error-message::before {
  content: "⚠️";
  margin-right: 0.5rem;
}

/* Success Message Styling */
.success-message {
  color: #38a169;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
}

.success-message::before {
  content: "✅";
  margin-right: 0.5rem;
}

/* =====================================================
   ACCESSIBILITY - KEYBOARD NAVIGATION
   ===================================================== */

.keyboard-navigation-active *:focus {
  outline: 3px solid var(--sage) !important;
  outline-offset: 2px !important;
}

/* =====================================================
   ACCESSIBILITY - HIGH CONTRAST MODE
   ===================================================== */

@media (prefers-contrast: high) {
  :root {
    --text-primary: #000000;
    --text-secondary: #2d3748;
    --sage: #2d5016;
    --stone: #1a202c;
  }
  
  .glass-intense,
  .nav-glassmorphism {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 2px solid #2d3748 !important;
  }
  
  .btn,
  .cta-button {
    border: 2px solid #2d3748 !important;
  }
}

/* =====================================================
   ACCESSIBILITY - READABLE TEXT
   ===================================================== */

.readable-text {
  line-height: 1.6;
  letter-spacing: 0.025em;
  word-spacing: 0.1em;
}

/* =====================================================
   ACCESSIBILITY - MODALS & OVERLAYS
   ===================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 8px;
  padding: 2rem;
  max-width: 500px;
  margin: 2rem auto;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.modal-content:focus {
  outline: none;
}

/* =====================================================
   ACCESSIBILITY - CONTENT UPDATES
   ===================================================== */

.content-updated {
  border-left: 4px solid var(--sage);
  padding-left: 1rem;
  background: rgba(178, 189, 163, 0.1);
}

/* =====================================================
   MOBILE OPTIMIZATION
   ===================================================== */

@media (max-width: 768px) {
  /* Enhanced Touch Targets */
  button,
  .btn,
  .cta-button,
  a,
  input,
  select,
  textarea {
    min-height: 48px;
    min-width: 48px;
    padding: 12px 16px;
  }
  
  /* Touch-Optimized Navigation */
  nav a {
    padding: 16px 20px;
    font-size: 1.1rem;
  }
  
  /* Mobile-Specific Spacing */
  .hero-content {
    padding: 2rem 1rem;
  }
  
  /* Mobile Card Layouts */
  .product-card {
    margin-bottom: 2rem;
    padding: 2rem 1.5rem;
  }
  
  /* Mobile-Optimized Text */
  h1 {
    font-size: clamp(2rem, 8vw, 3rem) !important;
    line-height: 1.2;
  }
  
  h2 {
    font-size: clamp(1.5rem, 6vw, 2.5rem) !important;
    line-height: 1.3;
  }
  
  p {
    font-size: clamp(1rem, 4vw, 1.125rem) !important;
    line-height: 1.6;
  }
}

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

/* Touch Gesture Enhancements */
.touch-enhanced {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(178, 189, 163, 0.3);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Mobile Swipe Interactions */
.swipeable {
  touch-action: pan-x;
  cursor: grab;
}

.swipeable:active {
  cursor: grabbing;
}

/* Mobile Touch Feedback */
.touch-feedback {
  transition: all 0.2s ease;
}

.touch-feedback:active {
  transform: scale(0.98);
  opacity: 0.8;
}

/* =====================================================
   MOBILE GLASSMORPHISM
   ===================================================== */

@media (max-width: 768px) {
  .glass-intense,
  .nav-glassmorphism {
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
  }
}

/* =====================================================
   MOBILE SCROLL OPTIMIZATIONS
   ===================================================== */

@media (max-width: 768px) {
  html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }
  
  body {
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
  }
}

/* =====================================================
   MOBILE ANIMATIONS
   ===================================================== */

@media (max-width: 768px) {
  .fade-in-up,
  .fade-in-left,
  .fade-in-right,
  .scale-in {
    animation-duration: 0.6s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  /* Reduced Parallax on Mobile */
  .parallax-element {
    transform: none !important;
  }
  
  /* Mobile-Optimized Hover Effects */
  .hover-lift:hover,
  .hover-lift:active {
    transform: translateY(-2px);
  }
  
  .magnetic {
    transform: none !important;
  }
}

/* =====================================================
   MOBILE NAVIGATION
   ===================================================== */

@media (max-width: 768px) {
  .hamburger {
    width: 48px;
    height: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 12px;
  }
  
  .hamburger span {
    width: 24px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
  }
  
  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
  }
  
  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }
  
  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
  }
}

/* =====================================================
   MOBILE MODALS
   ===================================================== */

@media (max-width: 768px) {
  .modal-content {
    margin: 1rem;
    padding: 1.5rem;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* =====================================================
   MOBILE PERFORMANCE OPTIMIZATIONS
   ===================================================== */

@media (max-width: 768px) {
  * {
    will-change: auto;
  }
  
  .gpu-accelerated {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
  }
  
  .reduce-motion {
    animation: none !important;
    transition: none !important;
  }
}

/* =====================================================
   MOBILE LAYOUT
   ===================================================== */

@media (max-width: 768px) {
  .block {
    padding: 3rem 1rem;
    min-height: auto;
  }
  
  .trilogy-reveal-container {
    padding: 2rem 1rem;
  }
  
  footer {
    padding: 2rem 1rem 1rem 1rem !important;
  }
  
  footer nav {
    flex-direction: column !important;
    gap: 1rem !important;
  }
}

/* =====================================================
   MOBILE BUTTONS
   ===================================================== */

@media (max-width: 768px) {
  .btn {
    font-size: 1rem;
    padding: 14px 24px;
    border-radius: 8px;
    font-weight: 600;
  }
  
  .btn-primary {
    background: linear-gradient(135deg, var(--sage), #8fa87a);
    box-shadow: 0 4px 15px rgba(178, 189, 163, 0.3);
  }
  
  .btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(178, 189, 163, 0.4);
  }
}

/* =====================================================
   MOBILE LANDSCAPE ORIENTATION
   ===================================================== */

@media (max-width: 768px) and (orientation: landscape) {
  .block {
    padding: 2rem 1rem;
  }
  
  h1 {
    font-size: clamp(1.8rem, 6vw, 2.5rem) !important;
  }
  
  .trilogy-reveal-container {
    padding: 1.5rem 1rem;
  }
}

/* =====================================================
   MOBILE ACCESSIBILITY
   ===================================================== */

@media (max-width: 768px) {
  .skip-nav {
    font-size: 1rem;
    padding: 12px 16px;
    top: -50px;
  }
  
  .skip-nav:focus {
    top: 10px;
  }
}

/* =====================================================
   MOBILE SWIPE INDICATORS
   ===================================================== */

.swipe-indicator {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  opacity: 0.7;
}

.swipe-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sage);
  transition: all 0.3s ease;
}

.swipe-dot.active {
  background: var(--stone);
  transform: scale(1.3);
}

/* =====================================================
   END OF ANIMATIONS STYLESHEET
   ===================================================== */

