/* =====================================
   BASE STYLES
   ===================================== */
body {
  background-color: #ffffff;
  color: #111;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
}

/* =====================================
   MOBILE PERFORMANCE OPTIMIZATIONS
   ===================================== */
/* Respect user's reduced motion preference */
@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;
  }

  .scroll-container {
    animation: none !important;
  }
}

/* Optimize for mobile devices */
@media (max-width: 768px) {
  /* Reduce backdrop-filter complexity on mobile */
  .glass-nav {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  /* Simplify transitions for better performance */
  .reveal-text,
  .reveal-fade {
    transition-duration: 0.4s;
  }

  /* Reduce animation complexity */
  .service-card {
    transform: none;
    will-change: auto;
  }

  .service-card:nth-child(2n) {
    transform: none;
  }
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6,
nav a {
  font-family: "Outfit", sans-serif;
}

html.lenis {
  height: auto;
}

/* =====================================
   REVEAL ANIMATIONS
   ===================================== */
.reveal-container {
  overflow: hidden;
}

.reveal-text {
  transform: translateY(100%);
  opacity: 0;
  transition:
    transform 1s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 1s cubic-bezier(0.16, 1, 0.3, 1);
  display: block;
}

.reveal-fade {
  opacity: 0;
  transform: translateY(20px) scale(0.98);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.active .reveal-text,
.reveal-text.active {
  transform: translateY(0);
  opacity: 1;
}

.active.reveal-fade,
.reveal-fade.active {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.delay-100 {
  transition-delay: 0.1s;
}
.delay-200 {
  transition-delay: 0.2s;
}
.delay-300 {
  transition-delay: 0.3s;
}
.delay-400 {
  transition-delay: 0.4s;
}
.delay-500 {
  transition-delay: 0.5s;
}

/* =====================================
   SCROLLING PROJECTS SHOWCASE
   ===================================== */
@keyframes scroll-left {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

@keyframes slide-up-appear {
  0% {
    opacity: 0;
    transform: translateY(60px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* NTI job title animation */
.nti-title {
  display: inline-block;
  animation: nti-pop 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
  transform-origin: center;
}

.nti-title:hover {
  transform: translateY(-2px) scale(1.01);
  transition: transform 170ms ease;
}

@keyframes nti-pop {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
  60% {
    opacity: 1;
    transform: translateY(-2px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.scroll-section-appear {
  animation: slide-up-appear 1s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both;
}

.scroll-container {
  /* JS controls transform for smooth, non-reset marquee */
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  perspective: 1000px;
  -webkit-perspective: 1000px;
  contain: layout style;
}

.scroll-container > * {
  will-change: auto;
}

.project-card {
  position: relative;
  background-color: #fafafa;
  border: 1.5px solid #f2f2f2;
  border-radius: 20px;
  box-shadow: inset 0 3px 0 #ffffff;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* Screw/Pin effect on corners */
.project-card::before,
.project-card::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  background-color: rgb(230, 230, 230);
  border-radius: 100%;
  box-shadow:
    rgba(0, 0, 0, 0.1) 0px 1px 1px 0px inset,
    rgb(255, 255, 255) 0px -0.5px 0px 0px inset;
  opacity: 1;
  z-index: 10;
}

.project-card::before {
  top: 12px;
  left: 12px;
}
.project-card::after {
  top: 12px;
  right: 12px;
}

.project-card .screw-bottom-left,
.project-card .screw-bottom-right {
  position: absolute;
  width: 6px;
  height: 6px;
  background-color: rgb(230, 230, 230);
  border-radius: 100%;
  box-shadow:
    rgba(0, 0, 0, 0.1) 0px 1px 1px 0px inset,
    rgb(255, 255, 255) 0px -0.5px 0px 0px inset;
  opacity: 1;
  z-index: 10;
}

.project-card .screw-bottom-left {
  bottom: 12px;
  left: 12px;
}

.project-card .screw-bottom-right {
  bottom: 12px;
  right: 12px;
}

.project-card img {
  transition: none;
  border-radius: 10px;
  box-shadow: 0px 10px 16px -3px rgba(0, 0, 0, 0.25);
}

/* =====================================
   SERVICE CARDS
   ===================================== */
.service-card {
  position: relative;
  background-color: #fafafa;
  border: 1.5px solid #f2f2f2;
  border-radius: 1.5rem;
  box-shadow: inset 0 3px 0 #ffffff;
  transform: perspective(1200px) rotateX(2deg) rotateY(-4deg);
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform;
  transition: transform 0.3s ease;
}

/* Fix text rendering/clipping inside transformed service cards */
.service-card h3 {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transform: translateZ(0);
  line-height: 1.15;
  display: block;
}

.service-card:nth-child(2n) {
  transform: perspective(1200px) rotateX(2deg) rotateY(4deg);
}

/* Disable hover and active effects on mobile for service cards */
@media (max-width: 768px) {
  .service-card {
    pointer-events: auto;
  }
  .service-card:hover > div > div > div,
  .service-card:active > div > div > div {
    transform: none !important;
  }
  @media (hover: none) {
    .service-card > div > div > div {
      transition: none !important;
    }
  }
}

/* =====================================
   NAVIGATION & GLASS EFFECT
   ===================================== */
.glass-nav {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
}

.hover-card {
  transition:
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

/* =====================================
   PAGE BOUNDARIES & VISUAL GUIDES
   ===================================== */
:root {
  --content-width: 900px;
}

.page-boundaries {
  position: relative;
  min-height: 100vh;
}

.page-boundaries::before,
.page-boundaries::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(229, 231, 235, 0.65) 5%,
    rgba(229, 231, 235, 0.95) 50%,
    rgba(229, 231, 235, 0.65) 95%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 1;
}

.page-boundaries::before {
  left: calc((100vw - var(--content-width)) / 2);
}
.page-boundaries::after {
  right: calc((100vw - var(--content-width)) / 2);
}

@media (max-width: 1024px) {
  :root {
    --content-width: calc(100vw - 64px);
  }
}

@media (max-width: 768px) {
  .page-boundaries::before,
  .page-boundaries::after {
    display: none;
  }
}

.bounded-section {
  position: relative;
}

.bounded-section::before,
.bounded-section::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(229, 231, 235, 0.4) 12%,
    rgba(229, 231, 235, 0.7) 50%,
    rgba(229, 231, 235, 0.4) 88%,
    transparent 100%
  );
  pointer-events: none;
}

.bounded-section::before {
  left: 0;
}
.bounded-section::after {
  right: 0;
}

@media (max-width: 768px) {
  .bounded-section::before,
  .bounded-section::after {
    display: none;
  }
}

/* =====================================
   MOBILE MENU
   ===================================== */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
  padding: 80px 32px 32px;
}

.mobile-menu.active {
  right: 0;
}

.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 99;
}

.mobile-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
