/* ========================================
   NEXUS VENTURES — Effects & Polish Layer
   ======================================== */

/* ========================================
   PREMIUM POLISH — Selection, Scrollbar, Grain
   ======================================== */
::selection {
  background: rgba(196, 145, 92, 0.25);
  color: inherit;
}
::-moz-selection {
  background: rgba(196, 145, 92, 0.25);
  color: inherit;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* Grain overlay — adds texture, kills sterile AI feel */
.grain {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 10000;
  opacity: 0.03;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Cursor spotlight — subtle glow follows mouse */
.cursor-spotlight {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(
    600px circle at var(--cursor-x, 50%) var(--cursor-y, 50%),
    rgba(240, 237, 232, 0.02),
    transparent 60%
  );
  transition: background 0.15s ease;
}

/* Vignette — darkens edges, centers focus */
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(
    ellipse at 50% 50%,
    transparent 55%,
    rgba(0, 0, 0, 0.25) 100%
  );
}

/* Focus states */
:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px #0E0E0E,
    0 0 0 4px rgba(196, 145, 92, 0.4);
  border-radius: 4px;
}
:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

/* Premium easing tokens */
:root {
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Typography polish */
body {
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern' 1, 'liga' 1;
}
.heading-lg, .heading-md, .heading-sm {
  text-wrap: balance;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* AMBIENT BACKGROUND */
.ambient {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
  overflow: hidden;
}
.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.035;
  animation: orb-float 25s ease-in-out infinite;
}
.ambient-orb:nth-child(1) {
  width: 600px; height: 600px;
  background: var(--primary);
  top: -200px; left: -100px;
}
.ambient-orb:nth-child(2) {
  width: 500px; height: 500px;
  background: var(--primary);
  bottom: -150px; right: -100px;
  animation-delay: -12s;
}
.ambient-orb:nth-child(3) {
  width: 350px; height: 350px;
  background: var(--primary);
  top: 40%; left: 60%;
  opacity: 0.035;
  animation-delay: -6s;
}

@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -25px) scale(1.05); }
  66% { transform: translate(-20px, 15px) scale(0.95); }
}

/* ========================================
   SCROLL REVEAL — Always alive, both directions
   ======================================== */
.reveal,
.service-card,
.sub-card,
.cap-card,
.pricing-card,
.process-step,
.stat,
.care-card,
.contact-block,
.faq-item,
.about-left,
.about-right {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s;
}
.visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}
.hidden {
  opacity: 0;
  transform: translateY(25px);
}

/* ========================================
   BUTTON INTERACTIONS — Subtle, premium
   ======================================== */
.btn {
  position: relative;
  transition: all 0.15s ease;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0) scale(0.97);
  transition-duration: 0.06s;
}

.nav-cta {
  transition: all 0.15s ease;
}
.nav-cta:hover {
  transform: translateY(-1px);
}
.nav-cta:active {
  transform: scale(0.96);
  transition-duration: 0.06s;
}

/* ========================================
   ROTATING WORD BAR
   ======================================== */
.word-bar {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  position: relative;
  z-index: 1;
}
.word-bar-track {
  display: flex;
  gap: 60px;
  animation: scroll-words 30s linear infinite;
  width: max-content;
}
.word-bar-track span {
  font-size: 13px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--text);
  opacity: 0.5;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 60px;
}
.word-bar-track span::after {
  content: '◆';
  font-size: 6px;
  opacity: 0.3;
}

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

.word-bar.reverse .word-bar-track {
  animation-direction: reverse;
}

.word-bar.fast .word-bar-track {
  animation-duration: 20s;
}

/* ========================================
   CARD HOVER 3D EFFECTS — True perspective
   ======================================== */
.service-card,
.sub-card,
.cap-card,
.pricing-card {
  transition: background 0.3s, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s;
  will-change: transform;
  transform-style: preserve-3d;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.service-card:hover,
.sub-card:hover,
.cap-card:hover {
  transform: translateY(-6px) perspective(1000px) rotateX(2deg) rotateY(-1deg);
  box-shadow:
    0 8px 16px rgba(0, 0, 0, 0.2),
    0 20px 40px rgba(0, 0, 0, 0.25),
    0 0 60px rgba(255, 255, 255, 0.025);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}
.pricing-card:hover {
  transform: translateY(-6px) perspective(1000px) rotateX(1.5deg) scale(1.01);
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.25),
    0 25px 50px rgba(0, 0, 0, 0.3),
    0 0 80px rgba(255, 255, 255, 0.03);
}

/* Card inner glow that follows mouse */
.service-card,
.sub-card,
.cap-card,
.pricing-card {
  position: relative;
  overflow: hidden;
}
.service-card::before,
.sub-card::before,
.cap-card::before,
.pricing-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: radial-gradient(
    500px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(255, 255, 255, 0.06) 0%, transparent 50%
  );
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
  z-index: 0;
}
.service-card:hover::before,
.sub-card:hover::before,
.cap-card:hover::before,
.pricing-card:hover::before {
  opacity: 1;
}

/* Card top edge highlight */
.service-card::after,
.sub-card::after,
.cap-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.4s;
}
.service-card:hover::after,
.sub-card:hover::after,
.cap-card:hover::after {
  opacity: 1;
}

/* ========================================
   DEVICE SHOWCASE LAYOUT
   ======================================== */
/* Two-column layout */
.showcase-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--body-pad);
}
.showcase-split.reverse {
  direction: rtl;
}
.showcase-split.reverse > * {
  direction: ltr;
}
.showcase-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.showcase-content .label {
  margin-bottom: 0;
}
.showcase-content h3 {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.2;
}
.showcase-content p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-muted);
}

/* ========================================
   HERO ENTRANCE ANIMATION
   ======================================== */
.hero .label,
.hero .heading-lg,
.hero .heading-sm,
.hero .heading-md,
.hero .subtitle,
.hero .scroll-btn {
  opacity: 0;
  transform: translateY(25px);
  animation: hero-enter 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero .label { animation-delay: 0.1s; }
.hero .heading-lg { animation-delay: 0.25s; }
.hero .heading-sm { animation-delay: 0.4s; }
.hero .subtitle { animation-delay: 0.55s; }
.hero .scroll-btn { animation-delay: 0.75s; }

@keyframes hero-enter {
  to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   PROCESS STEP ANIMATION — slides from sides
   ======================================== */
.process-step {
  opacity: 0;
  transform: translateX(-30px) translateY(15px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.process-step:nth-child(even) {
  transform: translateX(30px) translateY(15px);
}
.process-step.visible {
  opacity: 1;
  transform: translateX(0) translateY(0);
}
.process-step.hidden {
  opacity: 0;
}
.process-step:nth-child(even).hidden {
  transform: translateX(30px) translateY(15px);
}

/* ========================================
   STAT COUNTER ANIMATION
   ======================================== */
.stat {
  transform: translateY(20px) scale(0.93);
}
.stat.visible { transform: translateY(0) scale(1); }
.stat:nth-child(1) { transition-delay: 0s; }
.stat:nth-child(2) { transition-delay: 0.08s; }
.stat:nth-child(3) { transition-delay: 0.16s; }
.stat:nth-child(4) { transition-delay: 0.24s; }

/* ========================================
   SECTION HEADERS
   ======================================== */
.section .label,
.section .heading-md,
.section .heading-sm {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.section .label.visible,
.section .heading-md.visible,
.section .heading-sm.visible {
  opacity: 1;
  transform: translateY(0);
}
.section .label.hidden,
.section .heading-md.hidden,
.section .heading-sm.hidden {
  opacity: 0;
  transform: translateY(20px);
}

/* ========================================
   CTA SECTION ENHANCEMENT
   ======================================== */
.cta-section {
  position: relative;
  overflow: hidden;
}
.cta-section::before {
  content: '';
  position: absolute;
  top: -100px; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
  pointer-events: none;
}

/* ========================================
   FOOTER HOVER EFFECTS
   ======================================== */
.footer-links a {
  position: relative;
}
.footer-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1px;
  background: var(--primary);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.footer-links a:hover::after {
  width: 100%;
}

/* ========================================
   NAV TRANSITIONS
   ======================================== */
.nav {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.3s;
}

/* ========================================
   SMOOTH PAGE TRANSITIONS
   ======================================== */
body {
  overflow-x: hidden;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */
@media (max-width: 768px) {
  .word-bar { padding: 16px 0; }
  .word-bar-track span { font-size: 11px; letter-spacing: 3px; }
  .word-bar-track { gap: 40px; }

  .service-card:hover,
  .sub-card:hover,
  .cap-card:hover,
  .pricing-card:hover {
    transform: translateY(-3px);
  }

  .showcase-split {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .showcase-split.reverse {
    direction: ltr;
  }
}
