/* -----------------------------------------------------------------------------
   HORKOS STUDIO - LUXURY LIGHT-MODE EDITORIAL AESTHETIC
   Strict Color Identity:
   - Primary Blue: #0D4C8C (accent highlights, interactive anchors)
   - Deep Black:   #111011 (primary typography, sharp borders, dark nodes)
   - Soft White:   #F8FFFF (base clean backgrounds, glass panels)
   ----------------------------------------------------------------------------- */

:root {
  --brand-blue: #0D4C8C;
  --brand-black: #111011;
  --brand-white: #F8FFFF;
  --mouse-x: 50%;
  --mouse-y: 50%;
}

/* PREMIUM CINEMATIC FRAGMENTATION OVERLAY (GRAIN EFFECT) */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 250 250' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.04;
  pointer-events: none;
  z-index: 9999;
}

/* BASE EDITORIAL DECORATIVE STYLING */
* {
  min-width: 0;
}
html, body {
  overflow-x: hidden;
  width: 100%;
}
body {
  background-color: var(--brand-white);
  color: var(--brand-black);
  font-family: 'Outfit', sans-serif;
  min-height: 100dvh;
}

.font-space {
  font-family: 'Space Grotesk', sans-serif;
}

/* CINEMATIC PRELOADER STYLING */
#preloader {
  background-color: #D1E0EE; /* Fallback light blue-grey matching background.png */
  z-index: 9999;
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  transform: scale(1);
}

/* CINEMATIC ZOOM-THROUGH EXIT ANIMATION */
#preloader.preloader-hidden {
  opacity: 0;
  transform: scale(1.32); /* cinematic zoom-through scale up */
  pointer-events: none;
}

#preloader.preloader-hidden .preloader-content {
  opacity: 0;
  transform: scale(0.85); /* logo & loading bar scale down and disappear */
  filter: blur(4px);
}

.preloader-content {
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), filter 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  transform: scale(1);
  filter: blur(0);
}

/* HARDWARE-ACCELERATED SLOWLY PANNING & ZOOMING BACKGROUND GRADIENT */
@keyframes slowBgMove {
  0% {
    transform: scale(1) translate(0, 0);
  }
  50% {
    transform: scale(1.08) translate(1.5%, -1.2%);
  }
  100% {
    transform: scale(1) translate(0, 0);
  }
}

.preloader-bg-animation {
  background-image: url('images/background.png');
  animation: slowBgMove 28s ease-in-out infinite;
  width: 100%;
  height: 100%;
}

.morph-glass-tab {
  background: linear-gradient(
    135deg,
    rgba(248, 255, 255, 0.88) 0%,
    rgba(248, 255, 255, 0.74) 50%,
    rgba(248, 255, 255, 0.82) 100%
  );
  backdrop-filter: blur(40px) saturate(125%);
  -webkit-backdrop-filter: blur(40px) saturate(125%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 
    0 4px 30px rgba(13, 76, 140, 0.03),
    0 12px 40px rgba(17, 16, 17, 0.05),
    inset 0 1px 1.5px rgba(255, 255, 255, 0.85); /* Inner polished glass reflection */
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.morph-glass-tab:hover {
  background: linear-gradient(
    135deg,
    rgba(248, 255, 255, 0.94) 0%,
    rgba(248, 255, 255, 0.84) 100%
  );
  border-color: rgba(13, 76, 140, 0.22);
  box-shadow: 
    0 10px 35px rgba(13, 76, 140, 0.08),
    0 20px 50px rgba(17, 16, 17, 0.08),
    inset 0 1px 2px rgba(255, 255, 255, 0.95);
  transform: translateY(1px) scale(1.005);
}

/* Unified Link Styling inside Tab */
.morph-glass-tab .nav-link {
  color: var(--brand-black);
  opacity: 0.95; /* Maximized visibility */
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem; /* Slightly larger and sharper */
  font-weight: 500; /* Bolder for visibility */
  letter-spacing: 0.02em;
  padding: 0.4rem 1.1rem;
  border-radius: 9999px;
  transition: all 0.3s ease;
}

.morph-glass-tab .nav-link:hover {
  opacity: 1;
  background-color: rgba(13, 76, 140, 0.08);
  color: var(--brand-blue);
}

/* Glass Icon Action Buttons on Right */
.icon-action-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid rgba(17, 16, 17, 0.05);
  background: rgba(248, 255, 255, 0.2);
  color: var(--brand-black);
  opacity: 0.8;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.icon-action-btn:hover {
  opacity: 1;
  background: var(--brand-blue);
  color: var(--brand-white);
  border-color: var(--brand-blue);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 5px 15px rgba(13, 76, 140, 0.25);
}

.icon-action-btn:active {
  transform: translateY(0) scale(0.97);
}



/* LESSE BOTTOM NAVIGATION BAR (LIGHT MODE FROSTED GLASS) */
.navbar-bg {
  background: rgba(248, 255, 255, 0.7);
  border: 1px solid rgba(17, 16, 17, 0.08);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 10px 40px rgba(13, 76, 140, 0.06);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease;
}

.navbar-bg:hover {
  background: rgba(248, 255, 255, 0.95);
  box-shadow: 0 10px 40px rgba(13, 76, 140, 0.12);
}

/* PROGRESS FILL FOR HERO SLIDER (DARK ON LIGHT BACKGROUND) */
.progress-fill {
  background-color: var(--brand-blue);
  height: 100%;
  width: 0%;
  transition: width 0.1s linear;
}

.progress-fill.active {
  width: 100%;
}

/* SERVICE CARD STRUCTURE */
.service-slide-card {
  width: 100%;
  max-width: 275px;
  height: 415px;
  flex-shrink: 0;
  position: relative;
  border-radius: 1.5rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background-color: var(--brand-black);
  cursor: pointer;
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform 0.15s ease-out, box-shadow 0.4s ease;
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  isolation: isolate;
}

@media (min-width: 640px) {
  .service-slide-card {
    width: 100%;
    max-width: 310px;
    height: 450px;
  }
}

@media (min-width: 1024px) {
  .service-slide-card {
    width: 100%;
    max-width: 335px;
    height: 475px;
  }
}

@media (hover: hover) {
  .service-slide-card:hover {
    box-shadow: 0 25px 55px rgba(13, 76, 140, 0.22);
  }
}

.service-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(80%) contrast(1.05) blur(0px);
  transform: scale(1);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 0;
  border-radius: inherit;
}

@media (hover: hover) {
  .service-slide-card:hover .service-card-bg {
    filter: brightness(35%) contrast(1.1) blur(10px);
    transform: scale(1.12);
  }
}

.service-card-default-content {
  position: absolute;
  inset: 0;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 10;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 1024px) {
  .service-card-default-content {
    padding: 2.2rem;
  }
}

@media (hover: hover) {
  .service-slide-card:hover .service-card-default-content {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
  }
}

.service-card-hover-content {
  position: absolute;
  inset: 0;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 20;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 1024px) {
  .service-card-hover-content {
    padding: 2.2rem;
  }
}

@media (hover: hover) {
  .service-slide-card:hover .service-card-hover-content {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
}

/* ACTIVE STATE (click-to-expand) — mirrors hover but persists */
.service-slide-card.active .service-card-bg {
  filter: brightness(30%) contrast(1.1) blur(12px);
  transform: scale(1.12);
}

.service-slide-card.active .service-card-default-content {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
}

.service-slide-card.active .service-card-hover-content {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.service-slide-card.active {
  box-shadow: 0 30px 65px rgba(13, 76, 140, 0.28);
}

.sub-service-tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9999px;
  padding: 0.4rem 0.95rem;
  font-family: 'Outfit', sans-serif;
  font-size: 0.76rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.9) !important;
  width: fit-content;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none !important;
  cursor: pointer;
}

.sub-service-tag:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.32);
  color: #ffffff !important;
  transform: scale(1.05);
}

/* HORIZONTAL DRAGGABLE SCROLLER TRACK */
.scroller-container {
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  gap: 1.5rem;
  width: 100%;
  cursor: grab;
  user-select: none;
}

.scroller-container:active {
  cursor: grabbing;
}

.scrollbar-none {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE 10+ */
}

.scrollbar-none::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* CUSTOM DOT MATRIX BACKDROP FOR LIGHT MODE */
.dot-matrix {
  background-image: radial-gradient(rgba(17, 16, 17, 0.05) 1.5px, transparent 1.5px);
  background-size: 20px 20px;
}

.dot-grid-icon rect {
  transition: fill 0.3s ease;
}

.dot-grid-icon:hover rect {
  fill: var(--brand-blue) !important;
}

/* CUSTOM LERP CURSOR */
#custom-cursor {
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), height 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* EDITORIAL GLASS OVERLAYS */
.backdrop-blur-md {
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

/* IMAGE REVEALS ON SCROLL */
.image-reveal-container {
  overflow: hidden;
  position: relative;
}

.image-reveal-img {
  transform: scale(1.1);
  -webkit-clip-path: inset(100% 0 0 0);
  clip-path: inset(100% 0 0 0);
  transition: -webkit-clip-path 1.4s cubic-bezier(0.16, 1, 0.3, 1), clip-path 1.4s cubic-bezier(0.16, 1, 0.3, 1), transform 1.4s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: clip-path, transform;
}

.image-reveal-img.active {
  -webkit-clip-path: inset(0 0 0 0);
  clip-path: inset(0 0 0 0);
  transform: scale(1);
}

/* SCROLLBAR REFINEMENTS */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: var(--brand-white);
}

::-webkit-scrollbar-thumb {
  background: rgba(13, 76, 140, 0.25);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brand-blue);
}

/* AMBIENT LIGHT SHADOWS ON LIGHT */
.shadow-glow-blue {
  box-shadow: 0 0 35px rgba(13, 76, 140, 0.15);
}

.bg-radial-glow {
  background: radial-gradient(circle, rgba(13, 76, 140, 0.08) 0%, rgba(248, 255, 255, 0) 75%);
}

/* ROTATING LOADERS */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.animate-spin-slow {
  animation: spin 30s linear infinite;
}

/* ASYMMETRICAL SPACING STRETCHES */
.editorial-stagger {
  margin-bottom: 12vw;
}

@media(min-width: 1024px) {
  .editorial-stagger:nth-child(even) {
    padding-top: 8vw;
  }
}

/* INFINITE SLIDER TESTIMONIAL */
@keyframes infinite-slide {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.animate-infinite-slide {
  animation: infinite-slide 38s linear infinite;
}

.animate-infinite-slide:hover {
  animation-play-state: paused;
}

/* LIGHT MODE GLOW ON SERVICE CARDS (Disabled for Safari Stability) */
.service-slide-card::before, .project-card::before {
  display: none !important;
}

@media (hover: hover) {
  .service-slide-card:hover::before, .project-card:hover::before {
    opacity: 1;
  }
}

/* HERO SCROLL-MUTED BACKGROUND VIDEO & CINEMA CONTRAST */
#hero-bg-video {
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
  filter: brightness(92%) contrast(106%) saturate(104%);
  object-fit: cover;
}

#hero-volume-btn {
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* PROFESSIONAL MULTI-STOP MATHEMATICAL EASING GRADIENT */
.editorial-video-gradient {
  background: linear-gradient(
    to top,
    #111011 0%,
    rgba(17, 16, 17, 0.98) 8.1%,
    rgba(17, 16, 17, 0.92) 15.5%,
    rgba(17, 16, 17, 0.83) 22.5%,
    rgba(17, 16, 17, 0.71) 29%,
    rgba(17, 16, 17, 0.58) 35.3%,
    rgba(17, 16, 17, 0.44) 41.2%,
    rgba(17, 16, 17, 0.3) 47.1%,
    rgba(17, 16, 17, 0.18) 52.9%,
    rgba(17, 16, 17, 0.08) 58.8%,
    transparent 100%
  );
}

/* FLUID COLOR-SHIFTING PRELOADER BACKGROUND */
@keyframes preloaderBgShift {
  0% { background-color: #D1E0EE; }
  33% { background-color: #C5D7E8; }
  66% { background-color: #DDE8F4; }
  100% { background-color: #D1E0EE; }
}

#preloader {
  animation: preloaderBgShift 12s ease-in-out infinite;
}

/* PREMIUM GLOWING EDGE GRADIENTS (OPENING SECTION ONLY) */
.preloader-edge-glow {
  background: radial-gradient(circle, rgba(13, 76, 140, 0.45) 0%, rgba(209, 224, 238, 0.1) 50%, transparent 75%);
  filter: blur(80px);
  will-change: transform;
}

@keyframes edgeGlow1 {
  0% { transform: translate(-15%, -15%) scale(1); }
  50% { transform: translate(15%, 5%) scale(1.3); }
  100% { transform: translate(-15%, -15%) scale(1); }
}
@keyframes edgeGlow2 {
  0% { transform: translate(15%, 15%) scale(1.2); }
  50% { transform: translate(-5%, -15%) scale(0.9); }
  100% { transform: translate(15%, 15%) scale(1.2); }
}
@keyframes edgeGlow3 {
  0% { transform: translate(15%, -15%) scale(0.9); }
  50% { transform: translate(-15%, 10%) scale(1.2); }
  100% { transform: translate(15%, -15%) scale(0.9); }
}
@keyframes edgeGlow4 {
  0% { transform: translate(-15%, 15%) scale(1.3); }
  50% { transform: translate(10%, -5%) scale(1.0); }
  100% { transform: translate(-15%, 15%) scale(1.3); }
}

.animate-edge-glow-1 {
  animation: edgeGlow1 18s ease-in-out infinite;
}
.animate-edge-glow-2 {
  animation: edgeGlow2 20s ease-in-out infinite;
}
.animate-edge-glow-3 {
  animation: edgeGlow3 16s ease-in-out infinite;
}
.animate-edge-glow-4 {
  animation: edgeGlow4 22s ease-in-out infinite;
}

/* HAMBURGER TRANSFORMATION TO CROSS */
.menu-line-1, .menu-line-2, .menu-line-3 {
  transform-origin: center;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, background-color 0.4s ease;
}

#mobile-menu-btn.menu-active .menu-line-1 {
  transform: translateY(5px) rotate(45deg);
  background-color: var(--brand-blue) !important;
}

#mobile-menu-btn.menu-active .menu-line-2 {
  opacity: 0;
  transform: scale(0);
}

#mobile-menu-btn.menu-active .menu-line-3 {
  transform: translateY(-5px) rotate(-45deg);
  background-color: var(--brand-blue) !important;
}

#mobile-menu-btn.menu-active {
  background: var(--brand-white);
  border-color: var(--brand-blue) !important;
  box-shadow: 0 4px 15px rgba(13, 76, 140, 0.15);
}

/* FIXED HEADER BACKING SECTION GLOW ANIMATIONS */
@keyframes headerGlow1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(15%, 5%) scale(1.2); }
  100% { transform: translate(0, 0) scale(1); }
}
@keyframes headerGlow2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-15%, -5%) scale(0.85); }
  100% { transform: translate(0, 0) scale(1); }
}

.animate-header-glow-1 {
  animation: headerGlow1 16s ease-in-out infinite;
}
.animate-header-glow-2 {
  animation: headerGlow2 20s ease-in-out infinite;
}

/* PREMIUM ANIMATED TEXT GRADIENT (HORKOS COLORS) */
.animated-text-gradient {
  background: linear-gradient(
    90deg,
    #F8FFFF 0%,
    #0D4C8C 35%,
    #D1E0EE 50%,
    #0D4C8C 65%,
    #F8FFFF 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: textShine 7s linear infinite;
  will-change: background-position;
}

@keyframes textShine {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 200% center;
  }
}

/* PREMIUM EXPANDABLE HORIZONTAL CONTAINER SYSTEM (SERVICES PAGE ACCORDION) */
.expand-container-wrapper {
  display: flex;
  flex-direction: row;
  gap: 1.25rem;
  width: 100%;
  height: 540px;
  min-height: 480px;
  margin-top: 3rem;
  perspective: 1500px;
}

.expand-card {
  flex: 1;
  height: 100%;
  position: relative;
  border-radius: 1.75rem;
  overflow: hidden;
  cursor: pointer;
  background-color: var(--brand-black);
  border: 1px solid rgba(17, 16, 17, 0.08);
  transition: flex 0.85s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.6s ease;
  will-change: flex;
}

.expand-card:hover {
  box-shadow: 0 25px 55px rgba(13, 76, 140, 0.16);
}

.expand-card.active {
  flex: 5.2;
  cursor: default;
  box-shadow: 0 30px 65px rgba(13, 76, 140, 0.22);
}

.expand-card-bg {
  position: absolute;
  /* Fallback for Safari < 14.1 that doesn't support inset shorthand */
  top: -10px;
  right: -10px;
  bottom: -10px;
  left: -10px;
  inset: -10px;
  background-size: cover;
  background-position: center;
  filter: brightness(28%) contrast(1.05) blur(0px);
  transform: scale(1);
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), filter 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 0;
}

.expand-card.active .expand-card-bg {
  filter: brightness(38%) contrast(1.05);
  transform: scale(1.02);
}

@media (hover: hover) {
  .expand-card:hover:not(.active) .expand-card-bg {
    filter: brightness(45%) contrast(1.1);
    transform: scale(1.04);
  }
}

.expand-card-content {
  position: absolute;
  inset: 0;
  padding: 2.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 10;
  color: #ffffff;
}

.expand-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  opacity: 0.6;
  transition: opacity 0.5s ease;
}

.expand-card.active .expand-card-top {
  opacity: 1;
}
@media (hover: hover) {
  .expand-card:hover .expand-card-top {
    opacity: 1;
  }
}

.expand-card-number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  font-weight: 700;
  color: #ffffff;
}

.expand-card-title-vertical {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  white-space: nowrap;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.95);
  opacity: 1;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s ease;
  pointer-events: none;
}

@media (hover: hover) {
  .expand-card:hover:not(.active) .expand-card-title-vertical {
    color: #ffffff;
    transform: translate(-50%, -50%) rotate(-90deg) scale(1.05);
  }
}

.expand-card.active .expand-card-title-vertical {
  opacity: 0;
  transform: translate(-50%, -100%) rotate(-90deg);
  filter: blur(4px);
}

.expand-card-expanded-body {
  opacity: 0;
  transform: translateY(25px);
  pointer-events: none;
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1) 0.15s, transform 0.75s cubic-bezier(0.16, 1, 0.3, 1) 0.15s, filter 0.75s ease 0.15s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 1.5rem;
  width: 100%;
  height: auto;
  filter: blur(5px);
}

.expand-card.active .expand-card-expanded-body {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0px);
  pointer-events: auto;
}

@media (hover: hover) and (min-width: 769px) {
  .expand-card:hover:not(.active) {
    box-shadow: 0 25px 55px rgba(13, 76, 140, 0.16);
  }
}

/* RESPONSIVE ADAPTATIONS */
@media (max-width: 768px) {
  .expand-container-wrapper {
    flex-direction: column;
    height: auto;
    gap: 1.25rem;
  }
  
  .expand-card {
    flex: none !important;
    width: 100%;
    height: 100px;
    overflow: hidden;
    transition: height 0.8s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s ease;
  }
  
  .expand-card.active {
    height: 440px; /* Expanded space to fit description and tags */
  }
  
  .expand-card-content {
    padding: 1.25rem !important;
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .expand-card-top {
    height: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    opacity: 1 !important;
    transition: opacity 0.5s ease;
  }

  .expand-card.active .expand-card-top {
    height: auto;
    opacity: 0.6 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
  }

  .expand-card-title-vertical {
    position: absolute !important;
    top: 50% !important;
    left: 4.5rem !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    font-size: 1.15rem !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.15em !important;
    color: #ffffff !important;
    opacity: 1 !important;
    filter: none !important;
    white-space: nowrap !important;
    pointer-events: none !important;
    transform-origin: center !important;
  }

  .expand-card.active .expand-card-title-vertical {
    opacity: 0 !important;
    display: none !important;
  }

  .expand-card-expanded-body {
    position: relative !important;
    inset: auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    gap: 1rem !important;
    width: 100% !important;
    height: auto !important;
  }
}

/* ===========================================================================
   3D SCROLL-BASED ROTATING GALLERY CAROUSEL (PROJECT DETAIL PAGE)
   =========================================================================== */
.fixed-gallery-viewport {
  position: fixed;
  inset: 0;
  z-index: 15;
  overflow: hidden;
  pointer-events: none;
}

.fixed-gallery-viewport * {
  pointer-events: auto;
}

.gallery-3d-stage {
  position: relative;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  min-width: 320px;
  height: 52vh;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  perspective: 1500px;
  overflow: visible;
}

.gallery-slide-3d {
  position: absolute;
  width: 48vw;
  max-width: 620px;
  height: 31vw;
  max-height: 400px;
  border-radius: 1.5rem;
  overflow: hidden;
  background-color: var(--brand-black);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 25px 65px rgba(17, 16, 17, 0.35),
    0 5px 15px rgba(13, 76, 140, 0.08);
  transform-style: preserve-3d;
  will-change: transform, opacity;
  transition: opacity 0.1s ease;
}

.gallery-slide-3d img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.details-panel-bottom {
  position: absolute;
  bottom: 4vh;
  left: 50%;
  transform: translateX(-50%);
  width: 92vw;
  max-width: 1200px;
  background: rgba(248, 255, 255, 0.85);
  backdrop-filter: blur(30px) saturate(125%);
  -webkit-backdrop-filter: blur(30px) saturate(125%);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 2rem;
  padding: 1.75rem 2rem;
  box-shadow: 
    0 10px 30px rgba(13, 76, 140, 0.04),
    0 25px 60px rgba(17, 16, 17, 0.09),
    inset 0 1px 2px rgba(255, 255, 255, 0.85);
  z-index: 50;
}

@media (max-width: 1024px) {
  .gallery-slide-3d {
    width: 72vw;
    height: 48vw;
  }
}

@media (max-width: 768px) {
  .gallery-slide-3d {
    width: 82vw;
    height: 55vw;
  }
  
  .details-panel-bottom {
    border-radius: 1.5rem;
    padding: 1.25rem;
    bottom: 2.5vh;
  }
}

/* ===========================================================================
   ANIMATED GRADIENT FOR HERO TYPOGRAPHY BLOCK
   =========================================================================== */
.animated-hero-bg-gradient {
  position: relative;
  background-color: #111011;
  overflow: hidden;
  z-index: 10;
}

.animated-hero-bg-gradient::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at 20% 30%,
    rgba(13, 76, 140, 0.28) 0%,
    transparent 50%
  ), radial-gradient(
    circle at 80% 70%,
    rgba(13, 76, 140, 0.22) 0%,
    transparent 50%
  );
  animation: edgeGlowShift 28s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: -1;
}

@keyframes edgeGlowShift {
  0% {
    transform: rotate(0deg) translate(0, 0) scale(1);
  }
  50% {
    transform: rotate(180deg) translate(4%, -4%) scale(1.05);
  }
  100% {
    transform: rotate(360deg) translate(-2%, 2%) scale(1);
  }
}

/* ===========================================================================
   GRID-BASED EXPANDABLE SERVICES ACCORDION (SERVICES PAGE)
   =========================================================================== */
.services-grid-accordion {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  width: 100%;
}

@media (max-width: 1024px) {
  .services-grid-accordion {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .services-grid-accordion {
    grid-template-columns: 1fr;
  }
}

/* Expanded active state - maintains its exact 1-column grid position but increases height to show detailed info in place */
.services-grid-accordion .service-slide-card.active {
  height: 520px;
  cursor: default;
}

@media (max-width: 768px) {
  .services-grid-accordion .service-slide-card.active {
    height: auto;
    min-height: 480px;
  }
}

/* Toggle default vs active details container */
.services-grid-accordion .service-slide-card .active-split-container {
  display: none;
}

.services-grid-accordion .service-slide-card.active .default-grid-content {
  display: none !important;
}

/* Open vertically with clean responsive stacking */
.services-grid-accordion .service-slide-card.active .active-split-container {
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  gap: 1.25rem;
  height: 100%;
  position: relative;
  z-index: 10;
}

/* Stacking details inside active cards (unified across screen widths to fit span-1 constraints) */
.services-grid-accordion .active-left-panel {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.75rem;
}

.services-grid-accordion .active-right-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: #ffffff;
  width: 100%;
  text-align: left;
}


/* ============================================================================
   LIQUID GLASS DARK CTA BUTTON
   ============================================================================ */
.liquid-glass-btn {
  background: rgba(17, 16, 17, 0.78);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #ffffff;
  transition: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.liquid-glass-btn:hover {
  background: rgba(13, 76, 140, 0.88);
  box-shadow: 0 14px 44px rgba(13, 76, 140, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  border-color: rgba(13, 76, 140, 0.5);
  transform: scale(1.06) translateY(-2px);
}

/* VISIBLE ACTION PILL (Explore/Read More links) */
.action-pill-visible {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.2rem;
  border-radius: 9999px;
  background: var(--brand-black);
  color: var(--brand-white) !important;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}
.action-pill-visible:hover {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  box-shadow: 0 6px 24px rgba(13, 76, 140, 0.35);
  transform: translateY(-2px);
}

/* ============================================================================
   GSAP SCROLL REVEAL HELPERS
   ============================================================================ */
.reveal-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-up.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-fade {
  opacity: 0;
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-fade.revealed {
  opacity: 1;
}

.section-divider {
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand-blue), transparent);
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.section-divider.revealed {
  width: 100%;
}

/* ============================================================================
   MOBILE & TABLET RESPONSIVE OVERRIDES
   ============================================================================ */
@media (max-width: 480px) {
  .service-slide-card {
    width: 100%;
    max-width: 320px;
    height: 380px;
  }
  .liquid-glass-btn {
    font-size: 0.65rem;
    padding: 0 1.2rem;
    height: 2.75rem;
  }
}

@media (max-width: 768px) {
  .morph-glass-tab {
    padding: 0.6rem 1rem;
  }
  .service-slide-card {
    height: 400px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .service-slide-card {
    width: 290px;
    height: 430px;
  }
}

/* ============================================================================
   iOS / SAFARI WEBKIT GLOBAL COMPATIBILITY LAYER
   ============================================================================ */

/* Ensure smooth scroll works on Safari (CSS-level declaration) */
@supports (scroll-behavior: smooth) {
  html {
    scroll-behavior: smooth;
  }
}

/* Global WebKit backdrop-filter prefix guarantee for Safari */
@supports (-webkit-backdrop-filter: blur(1px)) {
  .morph-glass-tab,
  .navbar-bg,
  .liquid-glass-btn,
  .sub-service-tag,
  .details-panel-bottom,
  [class*="backdrop-blur"] {
    -webkit-backdrop-filter: blur(24px) saturate(1.25);
  }
}

/* Prevent iOS rubber-banding from revealing background on overscroll */
html {
  overscroll-behavior: none;
}

/* iOS text-size-adjust prevention (stops iOS from auto-enlarging text) */
body {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
