/* Avenir Font Family */
.font-avenir {
  font-family: 'Avenir', 'Avenir Next', 'Helvetica Neue', Arial, sans-serif;
}

body {
  font-family: 'Avenir', 'Avenir Next', 'Helvetica Neue', Arial, sans-serif;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* Fix text selection visibility for gradient text (bg-clip-text) */
.bg-clip-text::selection,
.bg-clip-text *::selection {
  -webkit-text-fill-color: white;
  background-color: rgba(56, 189, 248, 0.5);
}

/* Fix text selection on white/light backgrounds */
.bg-white::selection,
.bg-white *::selection {
  background-color: rgba(0, 0, 0, 0.15);
}

img {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  pointer-events: auto;
}

/* Custom Scrollbar Styling */
/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(107, 114, 128, 0.6) transparent;
}

*:hover {
  scrollbar-color: rgba(156, 163, 175, 0.8) transparent;
}

/* WebKit browsers (Chrome, Safari, Edge) */
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background-color: rgba(107, 114, 128, 0.6);
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background-color 0.2s ease;
}

*::-webkit-scrollbar-thumb:hover {
  background-color: rgba(156, 163, 175, 0.8);
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

/* Section intro spacing */
.section-intro {
  padding-top: 20vh;
  padding-bottom: 10vh;
}

@media (max-width: 639px) {
  .section-intro {
    padding-top: 12vh;
    padding-bottom: 6vh;
  }
}

/* Figure spacing */
.figure-spaced {
  margin-top: 10vh;
  margin-bottom: 10vh;
}

@media (max-width: 639px) {
  .figure-spaced {
    margin-top: 6vh;
    margin-bottom: 6vh;
  }
}

/* Paragraph break */
.paragraph-break {
  display: block;
  margin-top: 0.5em;
}

/* Global Margin Variables - Responsive based on screen size */

:root {
  /* Mobile (default, < 640px) */
  --margin-xs: 0.5rem;    /* 8px */
  --margin-sm: 1rem;      /* 16px */
  --margin-md: 1.5rem;    /* 24px */
  --margin-lg: 2rem;      /* 32px */
  --margin-xl: 3rem;      /* 48px */
  --margin-2xl: 4rem;     /* 64px */
  --margin-3xl: 6rem;     /* 96px */
  
  /* Horizontal margins */
  --margin-horizontal: 1.5rem;  /* 24px */
  
  /* Vertical margins */
  --margin-vertical: 2rem;      /* 32px */
  
  /* Hero image max height - default for mobile */
  --hero-max-height: 28vh; /* Mobile: 36% of viewport height */
}

/* Small screens (sm: ≥ 640px) */
@media (min-width: 640px) {
  :root {
    --margin-xs: 0.75rem;   /* 12px */
    --margin-sm: 1.25rem;   /* 20px */
    --margin-md: 2rem;      /* 32px */
    --margin-lg: 2.5rem;    /* 40px */
    --margin-xl: 4rem;      /* 64px */
    --margin-2xl: 5rem;     /* 80px */
    --margin-3xl: 8rem;     /* 128px */
    
    --margin-horizontal: 2rem;  /* 32px */
    --margin-vertical: 2.5rem;  /* 40px */
    
    --hero-max-height: 32vh; /* Small screens: 40% of viewport height */
  }
}

/* Medium screens (md: ≥ 768px) */
@media (min-width: 768px) {
  :root {
    --margin-xs: 1rem;      /* 16px */
    --margin-sm: 1.5rem;    /* 24px */
    --margin-md: 2.5rem;    /* 40px */
    --margin-lg: 3rem;      /* 48px */
    --margin-xl: 5rem;      /* 80px */
    --margin-2xl: 6rem;     /* 96px */
    --margin-3xl: 10rem;    /* 160px */
    
    --margin-horizontal: 2.5rem;  /* 40px */
    --margin-vertical: 3rem;      /* 48px */
    
    --hero-max-height: 36vh; /* Tablet: 44% of viewport height */
  }
}

/* Large screens (lg: ≥ 1024px) */
@media (min-width: 1024px) {
  :root {
    --margin-xs: 1rem;      /* 16px */
    --margin-sm: 2rem;      /* 32px */
    --margin-md: 3rem;      /* 48px */
    --margin-lg: 4rem;      /* 64px */
    --margin-xl: 6rem;      /* 96px */
    --margin-2xl: 8rem;     /* 128px */
    --margin-3xl: 12rem;    /* 192px */
    
    --margin-horizontal: 3rem;  /* 48px */
    --margin-vertical: 4rem;    /* 64px */
    
    --hero-max-height: 40vh; /* Desktop: 50% of viewport height */
  }
}

/* Extra large screens (xl: ≥ 1280px) */
@media (min-width: 1280px) {
  :root {
    --margin-xs: 1.25rem;   /* 20px */
    --margin-sm: 2rem;      /* 32px */
    --margin-md: 3.5rem;    /* 56px */
    --margin-lg: 5rem;      /* 80px */
    --margin-xl: 7rem;      /* 112px */
    --margin-2xl: 10rem;    /* 160px */
    --margin-3xl: 14rem;    /* 224px */
    
    --margin-horizontal: 3.5rem;  /* 56px */
    --margin-vertical: 5rem;      /* 80px */
    
    --hero-max-height: 44vh; /* Extra large: 44% of viewport height */
  }
}

/* 2XL screens (2xl: ≥ 1536px) */
@media (min-width: 1536px) {
  :root {
    --margin-xs: 1.5rem;    /* 24px */
    --margin-sm: 2.5rem;    /* 40px */
    --margin-md: 4rem;      /* 64px */
    --margin-lg: 6rem;      /* 96px */
    --margin-xl: 8rem;      /* 128px */
    --margin-2xl: 12rem;    /* 192px */
    --margin-3xl: 16rem;    /* 256px */
    
    --margin-horizontal: 4rem;  /* 64px */
    --margin-vertical: 6rem;    /* 96px */
    
    --hero-max-height: 50vh; /* 2XL: 50% of viewport height */
  }
}

/* Hero Section - Full viewport height black section (scrolls with page) */
.hero-bottom {
  width: 100%;
  display: flex;
  align-items: flex-end;
  position: relative;
  z-index: 1;
}

.hero-bottom img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  object-position: bottom;
  max-height: var(--hero-max-height);
}

/* Continuous Scrolling Logo Carousel */
@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.animate-scroll {
  animation: scroll 180s linear infinite;
  animation-play-state: paused;
  display: flex;
  will-change: transform;
  width: max-content;
  pointer-events: none;
}

.animate-scroll.loaded {
  animation-play-state: running;
}

.animate-scroll .logo-set {
  flex-shrink: 0;
  width: max-content;
}

.animate-scroll img {
  pointer-events: none;
  user-select: none;
  height: 3rem; /* h-12 */
  max-height: 3rem;
  width: auto;
  object-fit: contain;
}

@media (min-width: 640px) {
  .animate-scroll img {
    height: 4rem; /* sm:h-16 */
    max-height: 4rem;
  }
}

@media (min-width: 768px) {
  .animate-scroll img {
    height: 5rem; /* md:h-20 */
    max-height: 5rem;
  }
}

.screenshot-caption {
  transition: all 0.3s ease;
  padding: 0.5rem 0;
}

.screenshot-hover:hover .screenshot-caption {
  font-size: 1rem;
  color: rgb(31 41 55);
  font-weight: 500;
  padding: 0.75rem 1rem;
  background-color: rgba(0, 0, 0, 0.03);
  border-left: 3px solid rgb(107 114 128);
  margin-top: 1rem;
}

/* Fullscreen image styling */
img:fullscreen,
img:-webkit-full-screen,
img:-moz-full-screen,
img:-ms-fullscreen {
  max-width: 100vw;
  max-height: 100vh;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: auto;
  display: block;
}

/* Fullscreen backdrop styling */
img:fullscreen::backdrop,
img:-webkit-full-screen::backdrop,
img:-moz-full-screen::backdrop,
img:-ms-fullscreen::backdrop {
  background-color: #000000;
}

/* Modal overlay fallback for browsers without Fullscreen API support (iOS) */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.95);
  animation: fadeIn 0.3s ease;
}

.image-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: transparent;
  cursor: pointer;
}

.image-modal-img {
  position: relative;
  max-width: 100vw;
  max-height: 100vh;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: auto;
  cursor: pointer;
  animation: zoomIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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