:root {
  --squid-orange: #FF5C35;
  --squid-orange-glow: rgba(255, 92, 53, 0.4);
  --squid-dark: #1C0F3C;
  --squid-light: #F8FAFB;
  --squid-gray: #4B5563;
  --squid-border: rgba(255, 255, 255, 0.1);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.3);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--squid-light);
  color: var(--squid-dark);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  line-height: 1.1;
}

/* Smooth scrolling handled exclusively by Lenis engine in scripts.js */
html.lenis {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

html.has-scroll-smooth {
  overflow: hidden;
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
}

html.has-scroll-dragging {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.has-scroll-smooth body {
  overflow: hidden;
}

.has-scroll-smooth [data-scroll-container] {
  min-height: 100vh;
  opacity: 0;
  pointer-events: none;
  /* GPU compositing hint: promotes scroll canvas to its own layer */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.animate-marquee {
  display: flex;
  width: fit-content;
  animation: marquee 30s linear infinite;
  will-change: transform;
}

/* GPU-accelerated orb float — replaces removed GSAP continuous loop */
@keyframes orb-float-1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(40px, -25px); }
}
@keyframes orb-float-2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-40px, 25px); }
}

@keyframes scroll-line {
  0% { transform: translateY(-100%); }
  50% { transform: translateY(100%); }
  100% { transform: translateY(100%); }
}

.animate-scroll-line {
  animation: scroll-line 2.5s cubic-bezier(0.76, 0, 0.24, 1) infinite;
}

@keyframes pulse-subtle {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

.animate-pulse-subtle {
    animation: pulse-subtle 3s ease-in-out infinite;
}

@keyframes loading-bar {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(0); }
    100% { transform: translateX(100%); }
}

@keyframes preloader-reveal {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.animate-preloader-reveal {
    animation: preloader-reveal 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

[data-scroll-direction="horizontal"] [data-scroll-container] {
  height: 100vh;
  display: inline-block;
  white-space: nowrap;
}

[data-scroll-direction="horizontal"] [data-scroll-section] {
  display: inline-block;
  vertical-align: top;
  white-space: nowrap;
  height: 100%;
}

.c-scrollbar {
  position: absolute;
  right: 0;
  top: 0;
  width: 11px;
  height: 100%;
  transform-origin: center right;
  transition: transform 0.3s, opacity 0.3s;
  opacity: 0;
}

.c-scrollbar:hover {
  transform: scaleX(1.45);
}

.c-scrollbar:hover,
.has-scroll-scrolling .c-scrollbar,
.has-scroll-dragging .c-scrollbar {
  opacity: 1;
}

.c-scrollbar_thumb {
  position: absolute;
  top: 0;
  right: 0;
  /* Luxury UI Solid Color */
  background: #FF5C35;
  opacity: 0.6;
  width: 7px;
  border-radius: 10px;
  margin: 2px;
  cursor: -webkit-grab;
  cursor: grab;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: opacity 0.3s ease, width 0.3s ease, background 0.3s ease;
}

.has-scroll-dragging .c-scrollbar_thumb {
  cursor: -webkit-grabbing;
  cursor: grabbing;
}

/* Preloader Styles */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #FFFFFF;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  transition: opacity 0.5s ease-out;
}

#preloader.loaded {
  opacity: 0;
  pointer-events: none;
}

/* Logo Slider */
.logo-slider {
  display: flex;
  overflow: hidden;
  user-select: none;
  gap: 80px;
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.logo-slide-track {
  display: flex;
  gap: 80px;
  animation: scroll 30s linear infinite;
  min-width: 200%;
}

@keyframes scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.logo-slide-track img {
  height: 120px;
  width: auto;
  filter: grayscale(1) opacity(0.5);
  transition: all 0.3s ease;
}

.logo-slide-track img:hover {
  filter: grayscale(0) opacity(1);
}

/* Cinematic UI Tokens */
.glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

.glass-nav {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.mesh-gradient-bg {
  background-color: #F7F7F7;
  background-image: 
    radial-gradient(at 0% 0%, rgba(15, 15, 15, 0.03) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(255, 92, 53, 0.05) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(15, 15, 15, 0.03) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(255, 92, 53, 0.05) 0px, transparent 50%);
}

/* Entrance Animations & Reveals */
.reveal-fade-in {
  opacity: 0;
  will-change: opacity;
}

.reveal-slide-up {
  opacity: 0;
  transform: translateY(40px);
  will-change: opacity, transform;
}

.reveal-slide-left {
  opacity: 0;
  transform: translateX(40px);
  will-change: opacity, transform;
}

.reveal-slide-right {
  opacity: 0;
  transform: translateX(-40px);
  will-change: opacity, transform;
}

.reveal-scale-up {
  opacity: 0;
  transform: scale(0.9);
  will-change: opacity, transform;
}

/* Smooth transition for hover effects */
.hover-smooth {
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
              box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1),
              background-color 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Luxury Form Inputs */
.luxury-input {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(37, 34, 94, 0.1);
  transition: all 0.3s ease;
}

.luxury-input:focus {
  background: rgba(255, 255, 255, 1.0);
  border-color: #FF5C35;
  box-shadow: 0 0 0 4px rgba(255, 92, 53, 0.1);
}

/* Custom Cursor Animation (click!!) */
#custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 80px;
  height: 80px;
  background-color: #FF5C35;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 10000;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 0 20px rgba(255, 92, 53, 0.4);
}

#custom-cursor.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

#custom-cursor span {
  color: white;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 2px;
}

@media (max-width: 1024px) {
  #custom-cursor {
    display: none !important;
  }
}

/* Skeleton Loading UI */
.skeleton-box {
  background-color: #e2e8f0;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.skeleton-box::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0,
    rgba(255, 255, 255, 0.4) 20%,
    rgba(255, 255, 255, 0.7) 60%,
    rgba(255, 255, 255, 0)
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.skeleton-card {
  height: 350px;
  background: #f1f5f9;
  border-radius: 40px;
  position: relative;
  overflow: hidden;
}

.skeleton-shimmer {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: loading-shimmer 1.5s infinite linear;
}

@keyframes loading-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.fade-in-smooth {
  opacity: 0;
  animation: fadeInSmooth 0.8s forwards !important;
  pointer-events: all !important;
}

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

/* Superpower UI Design Tokens */
.island-nav {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 999px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

.island-nav-dark {
  background: rgba(15, 15, 15, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.super-btn {
  border-radius: 999px;
  will-change: transform;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.super-btn:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 15px 35px rgba(255, 92, 53, 0.3);
}

.super-card {
  border-radius: 32px;
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.03);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  will-change: transform;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.super-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.06);
}

.dark-theme-card {
  background: rgba(25, 25, 25, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
}

/* Lenis smooth scroll adjustments */
html.lenis {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

/* Modal & Overlay Polish */
body.modal-open {
    overflow: hidden;
    padding-right: 15px;
}

@media (max-width: 768px) {
    body.modal-open {
        padding-right: 0;
    }
}

#serviceModalContent::-webkit-scrollbar {
    width: 6px;
}

#serviceModalContent::-webkit-scrollbar-track {
    background: transparent;
}

#serviceModalContent::-webkit-scrollbar-thumb {
    background: #FF5C35;
    border-radius: 10px;
}

.transform-modal {
    perspective: 1000px;
}

/* ============================================================
   RESPONSIVE FIXES — Tablet & Mid-Screen (768px – 1024px)
   ============================================================ */

/* Hero: ensure it never collapses on small phones */
@media (max-width: 640px) {
    #hero {
        min-height: 90vh !important;
        padding-top: 7rem !important;
        padding-bottom: 5rem !important;
    }
    #hero h1 {
        font-size: clamp(2.4rem, 10vw, 4rem) !important;
        line-height: 1.05 !important;
    }
}

/* Marquee: prevent overflow clipping on narrow screens */
@media (max-width: 640px) {
    .animate-marquee {
        font-size: 1.4rem !important;
        gap: 2rem !important;
    }
    .animate-marquee span {
        white-space: nowrap;
    }
}

/* Services Bento Grid: fix col-span-2 breaking layout on md screens */
@media (min-width: 768px) and (max-width: 1023px) {
    .bento-grid {
        grid-template-columns: 1fr 1fr !important;
    }
    .bento-grid .lg\:col-span-2 {
        grid-column: span 2 !important;
    }
    .bento-grid .lg\:row-span-2 {
        grid-row: span 1 !important;
    }
    .service-bento {
        min-height: 280px;
    }
}

/* On mobile, bento cards get proper min-height so content isn't squished */
@media (max-width: 767px) {
    .service-bento {
        min-height: 260px;
    }
    .service-bento h3 {
        font-size: 1.6rem !important;
    }
}

/* "How We Work" steps: equal height cards at all breakpoints */
@media (min-width: 768px) and (max-width: 1023px) {
    #how-we-work .grid {
        grid-template-columns: 1fr 1fr 1fr !important;
        gap: 1.25rem !important;
    }
    #how-we-work .grid > div {
        padding: 1.75rem !important;
    }
    #how-we-work .text-6xl {
        font-size: 3rem !important;
    }
}

/* News section header: fix flex wrap on ~900px screens */
@media (max-width: 900px) {
    #news-feed-container {
        columns: 1 !important;
    }
}
@media (min-width: 640px) and (max-width: 900px) {
    #news-feed-container {
        columns: 2 !important;
    }
}

/* News tab filters: allow wrapping on small screens */
@media (max-width: 600px) {
    .news-tab {
        font-size: 0.65rem !important;
        padding: 0.5rem 0.875rem !important;
    }
}

/* FAQ section: prevent accordion summary overflow */
@media (max-width: 640px) {
    details summary {
        font-size: 1.1rem !important;
    }
    details .text-2xl.md\:text-3xl {
        font-size: 1.1rem !important;
    }
}

/* CTA section: fix aspect-ratio collapsing on very short screens */
@media (max-width: 640px) {
    [id='analysis'] .aspect-\[4\/5\] {
        aspect-ratio: auto !important;
        min-height: 480px;
    }
    [id='analysis'] h2 {
        font-size: clamp(2.5rem, 12vw, 5rem) !important;
    }
}

/* Tablet: CTA button text wrapping fix */
@media (min-width: 640px) and (max-width: 1023px) {
    .super-btn.inline-flex {
        font-size: 1rem !important;
        padding: 0.875rem 2rem !important;
        gap: 0.75rem !important;
    }
}

/* Footer: stack cleanly on mobile */
@media (max-width: 640px) {
    footer .flex.flex-col.md\:flex-row {
        gap: 1.5rem !important;
        text-align: center;
    }
}

/* Drawer sidebar: full-width on tiny phones */
@media (max-width: 400px) {
    #side-drawer {
        width: 100% !important;
    }
}

/* Reduced motion: disable all decorative animations */
@media (prefers-reduced-motion: reduce) {
    .animate-marquee,
    .animate-pulse,
    .animate-scroll-line,
    .animate-pulse-subtle,
    [style*='animation'] {
        animation: none !important;
        transition: none !important;
    }
    .reveal-slide-up,
    .reveal-fade-in,
    .reveal-slide-left,
    .reveal-slide-right {
        opacity: 1 !important;
        transform: none !important;
    }
}
