/* Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Ensure consistent font family */
body, html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Typography Override: All titles 32px and uppercase */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', serif;
  font-size: 32px !important;
  text-transform: uppercase !important;
}

/* Body text override: 16px */
p, .description-text, body {
  font-size: 16px !important;
}

/* Minimalist modern description text */
.description-text {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 300;
  font-style: normal;
  letter-spacing: -0.01em;
  line-height: 1.7;
}

/* Video Background Styles */
.hero-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  z-index: 0;
}

/* Hide all video controls - Maximum strength for iPad */
video {
  -webkit-appearance: none !important;
}

video::-webkit-media-controls {
  display: none !important;
  -webkit-appearance: none !important;
  opacity: 0 !important;
}

video::-webkit-media-controls-enclosure {
  display: none !important;
  opacity: 0 !important;
}

video::-webkit-media-controls-panel {
  display: none !important;
  opacity: 0 !important;
}

video::-webkit-media-controls-play-button {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

video::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
}

video::-webkit-media-controls-overlay-play-button {
  display: none !important;
  -webkit-appearance: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
}

video::-webkit-media-controls-overlay-enclosure {
  display: none !important;
  opacity: 0 !important;
}

/* Additional Safari control hiding */
video::-webkit-media-controls-timeline {
  display: none !important;
}

video::-webkit-media-controls-volume-slider {
  display: none !important;
}

video::-webkit-media-controls-mute-button {
  display: none !important;
}

video::-webkit-media-controls-fullscreen-button {
  display: none !important;
}

/* Completely disable pointer events on video itself */
#heroVideo {
  pointer-events: none !important;
}

#heroVideo::-webkit-media-controls-overlay-play-button {
  display: none !important;
  -webkit-appearance: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  pointer-events: none !important;
}

/* Make sure overlay is clickable */
#videoOverlay {
  pointer-events: auto !important;
  touch-action: manipulation !important;
}

/* GIF Fallback Styles */
.gif-fallback {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 0 !important;
}

.gif-fallback img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
}

/* Video Fallback Styles */
.video-fallback {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 0 !important;
}

/* Hide elements when not needed */
.hidden {
  display: none !important;
}

/* Ensure video covers entire hero on all screen sizes */
@media (max-aspect-ratio: 16/9) {
  .hero-video {
    width: 100%;
    height: auto;
  }
}

@media (min-aspect-ratio: 16/9) {
  .hero-video {
    width: auto;
    height: 100%;
  }
}

html {
  scroll-behavior: smooth;
  /* Disable scroll snap to prevent stopping at service cards */
  scroll-snap-type: none;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Typography */
.heading-h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 1.1;
}

.heading-h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.2;
}

.heading-h5 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  line-height: 1.3;
}

.heading-h6 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: 1.4;
}

.text-regular {
  font-size: 1rem;
  line-height: 1.5;
}

.text-medium {
  font-size: 1.125rem;
  line-height: 1.6;
}

.text-small {
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Clean Video Container Styles */
.video-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.video-frame {
  position: relative;
  width: 100%;
  max-width: 300px;
  aspect-ratio: 9/16;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

.video-frame:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 16px 48px rgba(0, 0, 0, 0.16),
    0 4px 16px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

.video-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
  display: block;
}

/* Play Button Overlay */
.play-button-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  pointer-events: auto;
}

.play-button-overlay:hover {
  background: rgba(0, 0, 0, 0.2);
}

.play-button-overlay:hover .play-button {
  transform: scale(1.1);
}

.play-button {
  transition: transform 0.3s ease;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.play-button svg {
  width: 80px;
  height: 80px;
}

/* Hide play button when video is playing */
.video-frame.playing .play-button-overlay {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .video-frame {
    max-width: 250px;
    border-radius: 12px;
  }
  
  .video-frame video {
    border-radius: 12px;
  }
  
  .play-button svg {
    width: 60px;
    height: 60px;
  }
}

/* Animation Classes - using scale and opacity for more reliable timing */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

/* Prevent flicker - elements start hidden */
section:not(.fade-in-up):not(.hero-section) {
  opacity: 0;
  transform: scale(0.95);
}

/* Portfolio items start hidden for animation - prevent flicker */
.portfolio-item {
  opacity: 0;
  transform: translateY(20px);
  transition: none;
  will-change: opacity, transform;
}

/* Contact hero section starts hidden for animation */
.contact-hero-section {
  opacity: 0;
  transform: translateY(20px);
  transition: none;
  will-change: opacity, transform;
}

/* Contact page sections start hidden for animation */
.contact-section {
  opacity: 0;
  transform: translateY(30px) scale(0.98);
  transition: none;
}

/* Ensure navigation and critical elements are always visible */
nav,
footer,
.hero-section:not(.contact-hero-section),
.mobile-menu {
  opacity: 1 !important;
  transform: none !important;
}

.fade-in-up {
  animation: scaleIn 1s ease-out forwards;
}

/* Portfolio animations - smooth and consistent */
.portfolio-item.fade-in-up {
  animation: portfolioFadeIn 0.9s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Contact hero section animation - same as portfolio */
.contact-hero-section.fade-in-up {
  animation: portfolioFadeIn 0.9s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.contact-section.fade-in-up {
  animation: scaleIn 0.9s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Project detail page animations - slower for better visibility */
.project-section {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.8s cubic-bezier(0.4, 0, 0.2, 1), transform 1.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Portfolio-specific fade in animation */
@keyframes portfolioFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-left {
  animation: slideInLeft 0.6s ease-out forwards;
}

/* Smooth transitions for all interactive elements */
a, button, input, select, textarea {
  transition: all 0.3s ease-in-out;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f8f8f8;
}

::-webkit-scrollbar-thumb {
  background: #171717;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #333;
}

/* Selection color */
::selection {
  background: #171717;
  color: #ffffff;
}

::-moz-selection {
  background: #171717;
  color: #ffffff;
}

/* Container */
.container {
  max-width: 1440px;
  margin: 0 auto;
}

/* Navigation enhancements */
nav {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999 !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  background: rgba(255, 255, 255, 0.95) !important;
  opacity: 1 !important;
  visibility: visible !important;
}

nav.shadow-md {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Navigation link hover effects - Enhanced visibility */
nav a {
  position: relative;
  transition: opacity 0.4s ease;
  overflow: visible;
}

/* No underline effect - just opacity fade */
nav a:not([class*="border"]):hover {
  opacity: 0.6;
}

/* Prevent bubble effect on nav links */
nav a::before,
nav a::after {
  display: none !important;
}

/* Mobile Menu Specific Styles */
#mobileMenu {
  overflow-y: auto;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: white !important;
  z-index: 998 !important;
}

#mobileMenu > div {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-height: 100vh !important;
  height: 100% !important;
  padding: 2rem !important;
  gap: 2rem !important;
  box-sizing: border-box !important;
}

#mobileMenu a {
  display: block !important;
  text-align: center !important;
  white-space: nowrap !important;
  font-size: 1rem !important;
  letter-spacing: 0.2em !important;
  text-transform: uppercase !important;
  color: #171717 !important;
  text-decoration: none !important;
  transition: all 0.3s ease !important;
}

#mobileMenu a:hover {
  opacity: 0.6 !important;
}

/* Contact button in mobile menu */
#mobileMenu a[style*="border"] {
  border: 1px solid #171717 !important;
  padding: 1rem 2.5rem !important;
  margin-top: 1rem !important;
}

/* Smooth hover effects - Only for CTA buttons in nav and sections */
nav a[class*="border-black"], 
section a[class*="border-black"], 
footer a[class*="border-black"],
button[type="submit"] {
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

/* Large smooth bubble effect on hover - Only for CTA buttons */
nav a[class*="border-black"]::before,
section a[class*="border-black"]::before,
footer a[class*="border-black"]::before,
button[type="submit"]::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  transform: translate(-50%, -50%);
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  pointer-events: none;
  z-index: 0;
}

nav a[class*="border-black"]:hover::before,
section a[class*="border-black"]:hover::before,
footer a[class*="border-black"]:hover::before,
button[type="submit"]:hover::before {
  width: 500px;
  height: 500px;
}

/* Make text stay on top of bubble */
nav a[class*="border-black"] > *,
section a[class*="border-black"] > *,
footer a[class*="border-black"] > *,
button[type="submit"] > * {
  position: relative;
  z-index: 1;
}

/* Icon hover effect - smooth scale - only for social icons */
footer a i {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

footer a:hover i {
  transform: scale(1.15);
}

/* Regular links and article links - enhanced visibility */
a:not([class*="border"]):not(nav a),
article a {
  transition: opacity 0.4s ease;
}

/* Prevent any pseudo elements and animations on portfolio items and service items */
article a::before,
article p::before,
article h2::before,
article h3::before,
article::before,
article::after,
article div::before,
article div::after,
.group::before,
.group::after,
.group *::before,
.group *::after {
  display: none !important;
}

/* Portfolio items and service items - completely static, no movement */
article:not(.portfolio-item), article:not(.portfolio-item) *,
.group, .group * {
  position: static !important;
}

/* Allow transform for portfolio animations */
article:not(.portfolio-item) {
  transform: none !important;
}

article a,
.group {
  position: relative !important;
  overflow: visible !important;
}

/* No movement, no scale, no transform on hover */
article:hover,
article a:hover,
article img:hover,
article div:hover,
.group:hover,
.group:hover *,
.group h2:hover,
.group p:hover {
  transform: none !important;
  scale: 1 !important;
}

/* Service items - completely static, no hover effects */
.service-item,
.service-item *,
.group:hover h2 {
  opacity: 1 !important;
  transform: none !important;
}

.service-item::before,
.service-item::after,
.service-item *::before,
.service-item *::after {
  display: none !important;
}

/* Form elements */
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #171717;
  box-shadow: 0 0 0 3px rgba(23, 23, 23, 0.1);
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
  accent-color: #171717;
}

/* Image hover effects */
img {
  transition: transform 0.3s ease;
}

a:hover img {
  transform: scale(1.05);
}

/* Card hover effects - optimized for visibility and performance */
.group {
  transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}

.group:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

/* Pulse animation for CTAs */
@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(23, 23, 23, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(23, 23, 23, 0);
  }
}

.btn-pulse {
  animation: pulse 2s infinite;
}

/* Sticky services section */
.sticky {
  position: sticky;
  top: 0;
  scroll-snap-align: none;
}

/* Gradient overlays */
.gradient-overlay {
  position: relative;
}

.gradient-overlay::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.1) 100%);
  pointer-events: none;
}

/* Badge styles */
[data-slot="badge"] {
  transition: background-color 0.2s ease, transform 0.2s ease;
}

[data-slot="badge"]:hover {
  background-color: #171717;
  color: #ffffff;
  transform: scale(1.05);
}

/* Loading state */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid #171717;
  outline-offset: 2px;
}

/* Print styles */
@media print {
  nav, footer, button {
    display: none;
  }
  
  body {
    font-size: 12pt;
  }
  
  h1, h2, h3 {
    page-break-after: avoid;
  }
  
  img {
    max-width: 100% !important;
  }
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .text-regular {
    font-size: 0.9375rem;
  }
  
  .text-medium {
    font-size: 1rem;
  }
}

/* Reduce motion for users who prefer it */
@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;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  body {
    color: #000;
    background: #fff;
  }
  
  a {
    text-decoration: underline;
  }
  
  button, .btn {
    border: 2px solid currentColor;
  }
}

/* Dark mode support (for future implementation) */
@media (prefers-color-scheme: dark) {
  /* Uncomment and customize when adding dark mode */
  /*
  :root {
    --bg-primary: #171717;
    --bg-secondary: #262626;
    --text-primary: #ffffff;
    --text-secondary: #a3a3a3;
  }
  */
}

/* Utility classes */
.text-gradient {
  background: linear-gradient(135deg, #171717 0%, #525252 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.shadow-soft {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.shadow-hard {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* Custom checkbox and radio styles */
input[type="checkbox"],
input[type="radio"] {
  cursor: pointer;
}

input[type="checkbox"]:checked + label,
input[type="radio"]:checked + label {
  font-weight: 600;
}

/* Hover effect for social icons */
footer a svg,
section a svg {
  transition: transform 0.2s ease, color 0.2s ease;
}

footer a:hover svg,
section a:hover svg {
  transform: scale(1.1);
}

/* Portfolio items - ensure smooth consistent animations */
.portfolio-item img {
  opacity: 1;
  transition: none;
  will-change: auto;
}

/* Ensure no conflicting animations on portfolio items */
.portfolio-item,
.portfolio-item * {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
  -webkit-font-smoothing: antialiased;
}

/* Custom select dropdown arrow */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%23171717' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

/* Smooth page transitions - simplified for better performance */
body {
  opacity: 1;
  animation: none;
}

/* Ensure navigation is always visible */
body nav {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Page transition overlay */
.page-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-transition.active {
  opacity: 1;
  pointer-events: all;
}

/* Link hover - simple fade only, no underline */
a:not(.inline-flex) {
  position: relative;
  transition: opacity 0.3s ease;
}

a:not(.inline-flex):hover {
  opacity: 0.6;
}

/* Disable any ::after underlines */
a::after {
  display: none !important;
}

/* Skip to main content (accessibility) */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #171717;
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* Form error states */
input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown),
select:invalid:not(:placeholder-shown) {
  border-color: #ef4444;
}

input:valid:not(:placeholder-shown),
textarea:valid:not(:placeholder-shown),
select:valid:not(:placeholder-shown) {
  border-color: #10b981;
}

/* Success message animation */
@keyframes slideDown {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

#formMessage:not(.hidden) {
  animation: slideDown 0.3s ease-out;
}

/* Professional cursor for interactive elements */
a, button, input[type="submit"], input[type="checkbox"], input[type="radio"], select {
  cursor: pointer;
}

/* Improved focus states for keyboard navigation */
*:focus-visible {
  outline: 2px solid #171717;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Preloader styles (optional) */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
}



