/* 
  Korelectics - Core Design System 
  Fonts: Bebas Neue (Headings), Poppins (Body)
*/

:root {
  --ink-900: #0A0B0D;
  --ink-800: #101216;
  --ink-700: #171A20;
  --ink-600: #1F232B;
  --bone-50: #F5F3EE;
  --bone-100: #EDEAE2;
  --bone-200: #D9D4C7;
  --accent-lime: #D4FF4A;
  --accent-amber: #E8B86A;
}

* { 
  -webkit-font-smoothing: antialiased; 
  -moz-osx-font-smoothing: grayscale; 
  box-sizing: border-box;
}

html { 
  scroll-padding-top: 100px; 
  overflow-x: clip; 
}

html, body { 
  max-width: 100vw; 
}

body {
  background: var(--ink-900);
  color: var(--bone-50);
  font-family: 'Inter', sans-serif;
  overflow-x: clip;
  width: 100%;
  position: relative;
  margin: 0;
}

/* Hero Image Wrapper */
.hero-image-wrapper {
  perspective: 1000px;
}
.hero-image-wrapper .glass {
  transform: rotateY(-5deg) rotateX(2deg);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.hero-image-wrapper:hover .glass {
  transform: rotateY(0deg) rotateX(0deg);
}



/* Floating Animations */
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}
.animate-float {
  animation: float 6s ease-in-out infinite;
}
.delay-1 { animation-delay: 2s; }
.delay-2 { animation-delay: 4s; }

.tech-node {
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Global Typography Updates */
h1, h2, h3 {
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.02em;
}

.display { 
  font-family: 'Inter', sans-serif; 
  letter-spacing: -0.02em; 
}

.mono { 
  font-family: 'DM Mono', monospace; 
}

/* Lenis smooth scroll */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* SplitType char animation base */
.split-line { overflow: hidden; }
.split-line .word, .split-line .char { display: inline-block; will-change: transform; }

/* Custom cursor */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  will-change: transform;
  mix-blend-mode: difference;
}
.cursor-dot {
  width: 6px; height: 6px;
  background: #F5F3EE;
}
.cursor-ring {
  width: 36px; height: 36px;
  border: 1px solid rgba(245, 243, 238, 0.4);
  transition: width 0.3s, height 0.3s, background 0.3s, border-color 0.3s;
}
.cursor-ring.expand {
  width: 64px; height: 64px;
  background: rgba(212, 255, 74, 0.15);
  border-color: rgba(212, 255, 74, 0.6);
}
@media (max-width: 768px) {
  .cursor-dot, .cursor-ring { display: none; }
}

/* Anchor offset for fixed nav */
section[id] { scroll-margin-top: 100px; }

/* Section-level overflow guard */
section { overflow-x: clip; }

/* Grain texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.grid-bg {
  background-image:
    linear-gradient(rgba(245, 243, 238, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 243, 238, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.5;
}

/* Marquee */
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.marquee-track {
  animation: marquee 40s linear infinite;
  width: max-content;
}

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1), transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* Card hover */
.service-card {
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}
.service-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 50%), rgba(212, 255, 74, 0.08), transparent 40%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.service-card:hover::before { opacity: 1; }
.service-card:hover { border-color: rgba(212, 255, 74, 0.3); transform: translateY(-2px); }

/* Glassmorph */
.glass {
  background: linear-gradient(135deg, rgba(245, 243, 238, 0.04), rgba(245, 243, 238, 0.01));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(245, 243, 238, 0.08);
}

/* Button styles */
.btn-primary {
  background: var(--accent-lime);
  color: var(--ink-900);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  border: none;
  cursor: pointer;
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.4) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s;
}
.btn-primary:hover::after { transform: translateX(100%); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 40px -8px rgba(212, 255, 74, 0.4); }

.btn-ghost {
  border: 1px solid rgba(245, 243, 238, 0.15);
  transition: all 0.3s;
  background: transparent;
  color: var(--bone-50);
  cursor: pointer;
}
.btn-ghost:hover {
  border-color: var(--bone-50);
  background: rgba(245, 243, 238, 0.05);
}

/* Stat Number */
.stat-num {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  line-height: 0.9;
}

/* Process line */
.process-line {
  background: linear-gradient(90deg, transparent, rgba(212, 255, 74, 0.4), rgba(212, 255, 74, 0.4), transparent);
}

/* Tech orb */
.tech-orb {
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.tech-orb:hover {
  transform: translateY(-4px);
  background: rgba(212, 255, 74, 0.06);
  border-color: rgba(212, 255, 74, 0.3);
}

/* Highlight underline */
.highlight-line {
  position: relative;
  display: inline-block;
}
.highlight-line::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.05em;
  height: 0.4em;
  background: var(--accent-lime);
  opacity: 0.3;
  z-index: -1;
  transform: skewX(-8deg);
}

/* Vertical text */
.vertical-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--ink-900); }
::-webkit-scrollbar-thumb { background: var(--ink-600); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-500); }

/* Floating tag */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.float-anim { animation: float 4s ease-in-out infinite; }

/* Team track */
.team-track::-webkit-scrollbar { display: none; }
.team-track { scrollbar-width: none; -ms-overflow-style: none; }

@keyframes swipeHint {
  0%, 100% { transform: translateX(0); opacity: 0.5; }
  50% { transform: translateX(8px); opacity: 1; }
}
.swipe-hint { display: inline-block; animation: swipeHint 1.6s ease-in-out infinite; }

@media (max-width: 639px) {
  .team-track .team-card {
    transition: transform 0.45s ease, opacity 0.45s ease;
    opacity: 0.55;
    transform: scale(0.93);
  }
  .team-track .team-card.is-active {
    opacity: 1;
    transform: scale(1);
  }
}

/* SVG Animations */
@keyframes orbit-slow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes orbit-rev  { from { transform: rotate(360deg); } to { transform: rotate(0deg); } }
@keyframes orbit-fast { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.orbit-slow { animation: orbit-slow 40s linear infinite; transform-origin: center; transform-box: fill-box; }
.orbit-mid  { animation: orbit-rev 24s linear infinite; transform-origin: center; transform-box: fill-box; }
.orbit-fast { animation: orbit-fast 12s linear infinite; transform-origin: center; transform-box: fill-box; }

@keyframes dash-flow { to { stroke-dashoffset: -28; } }
.draw-line-loop {
  stroke-dasharray: 6 8;
  animation: dash-flow 3s linear infinite;
}

@keyframes pulse-ring {
  0%   { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(2);   opacity: 0;   }
}
.pulse-ring {
  animation: pulse-ring 3s ease-out infinite;
  transform-origin: center;
  transform-box: fill-box;
}

@keyframes float-particle {
  0%, 100% { transform: translate(0, 0); }
  33%      { transform: translate(8px, -12px); }
  66%      { transform: translate(-6px, 8px); }
}
.particle {
  animation: float-particle 6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

/* Portfolio card */
.portfolio-card {
  transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.portfolio-card:hover .portfolio-img {
  transform: scale(1.04);
}
.portfolio-img {
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.section-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: rgba(245, 243, 238, 0.4);
}

.magnetic { transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1); }

.accent-link {
  position: relative;
  display: inline-block;
  color: inherit;
  text-decoration: none;
}
.accent-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.accent-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.gradient-text {
  background: linear-gradient(135deg, var(--bone-50) 0%, var(--bone-200) 60%, var(--accent-amber) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Team Card Premium Effect */
.team-card-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 25%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
  opacity: 1;
  transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 10;
}
.group:hover .team-card-overlay {
  opacity: 0;
}

.team-text-container {
  transition: all 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  background: transparent;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  border-top: 1px solid transparent;
}
.group:hover .team-text-container {
  background: rgba(245, 243, 238, 0.08);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-top: 1px solid rgba(212, 255, 74, 0.2);
  transform: translateY(0);
}
.group:hover img {
  filter: brightness(1.1) contrast(1.05);
}

.team-badge {
  background: rgba(212, 255, 74, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(212, 255, 74, 0.2);
  color: var(--accent-lime);
  padding: 6px 16px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.group:hover .team-badge {
  background: var(--accent-lime);
  color: var(--ink-900);
  border-color: var(--accent-lime);
}

.team-arrow-btn {
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transform: scale(0.8);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.group:hover .team-arrow-btn {
  transform: scale(1);
  opacity: 1;
  background: black;
}

.team-content-reveal {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.group:hover .team-content-reveal {
  max-height: 200px;
  opacity: 1;
  transform: translateY(0);
}

/* WhatsApp & Callback */
@keyframes wave {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
}

.whatsapp-pulse {
  animation: wave 2s ease-in-out infinite;
}

.callback-trigger {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: var(--accent-lime);
  color: var(--ink-900);
  padding: 20px 10px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  z-index: 100;
  border-radius: 8px 0 0 8px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: -4px 0 20px rgba(212, 255, 74, 0.2);
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.callback-trigger:hover {
  padding-right: 15px;
  filter: brightness(1.1);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.callback-modal {
  background: rgba(16, 18, 22, 0.98);
  width: 100%;
  max-width: 900px;
  border-radius: 32px;
  border: 1px solid rgba(245, 243, 238, 0.1);
  position: relative;
  transform: translateY(40px);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  padding: 48px;
  box-shadow: 0 25px 100px rgba(0, 0, 0, 0.6);
}
.modal-overlay.active .callback-modal {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(245, 243, 238, 0.05);
  display: flex;
  items-center justify-center cursor-pointer hover:bg-accent-lime hover:text-ink-900 transition-all;
}

.modal-header h3 {
  font-size: 2.5rem;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.modal-form {
  margin-top: 32px;
}

.input-group {
  margin-bottom: 16px;
}

.modal-input, .contact-input {
  width: 100%;
  background: rgba(245, 243, 238, 0.03) !important;
  border: 1px solid rgba(245, 243, 238, 0.1) !important;
  border-radius: 12px;
  padding: 16px 20px;
  color: #F5F3EE !important;
  font-size: 15px;
  outline: none;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  appearance: none;
}
.modal-input:focus, .contact-input:focus {
  border-color: var(--accent-lime) !important;
  background: rgba(245, 243, 238, 0.06) !important;
  box-shadow: 0 0 0 4px rgba(212, 255, 74, 0.1);
}

.modal-select, select.contact-input {
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9l6 6 6-6' stroke='rgba(245, 243, 238, 0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 20px center !important;
  padding-right: 45px !important;
}

.modal-select option, select.contact-input option {
  background-color: #0A0B0D !important;
  color: #F5F3EE !important;
  padding: 10px;
}

.submit-btn {
  width: 100%;
  background: var(--accent-lime);
  color: var(--ink-900);
  padding: 18px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.submit-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(212, 255, 74, 0.25);
  filter: brightness(1.05);
}

.leaf-btn {
  border-radius: 20px 0 20px 0;
  transition: all 0.3s ease;
}
.leaf-btn:active {
  transform: scale(0.95);
  filter: brightness(0.9);
}

/* Stacked Portfolio Cards */
.portfolio-container {
  display: flex;
  flex-direction: column;
  gap: 20px; /* Mobile gap */
  margin-top: 40px;
}

@media (min-width: 1024px) {
  .portfolio-container {
    gap: 0;
  }
  .portfolio-card-wrapper {
    position: sticky;
    top: 100px;
    padding-bottom: 5vh;
    transform-origin: center top;
  }
}

/* Swiper Mobile Specifics */
@media (max-width: 1023px) {
  .portfolio-container.swiper {
    overflow: visible !important; /* Allow slides to be seen during swipe */
  }
  .portfolio-container.swiper .swiper-wrapper {
    display: flex !important; /* Force flex for swiper-wrapper on mobile */
  }
  .portfolio-container.swiper .swiper-slide {
    width: 85% !important; /* Show a peek of the next slide */
    height: auto;
  }
}

.portfolio-card-wrapper {
  width: 100%;
  height: auto;
}

.portfolio-card {
  background: var(--ink-800);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 40px;
  overflow: hidden;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.4);
}

.portfolio-card.glass-theme {
  background: rgba(245, 243, 238, 0.03);
  backdrop-filter: blur(30px);
  border: 1px solid rgba(245, 243, 238, 0.1);
}
.portfolio-card.white-theme {
  background: #F5F3EE;
  color: #0A0B0D;
}
.portfolio-card.white-theme .text-bone-50\/40,
.portfolio-card.white-theme .text-bone-50\/60,
.portfolio-card.white-theme .text-bone-50\/75,
.portfolio-card.white-theme .text-bone-50\/90 {
  color: rgba(10, 11, 13, 0.7);
}
.portfolio-card.white-theme .accent-link {
  color: #0A0B0D;
  border-bottom-color: #0A0B0D;
}

.portfolio-img-wrapper {
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.portfolio-card:hover .portfolio-img-wrapper {
  transform: scale(1.02);
}

/* Swiper Pagination Styling */
.swiper-pagination-bullet {
  background: var(--bone-50) !important;
  opacity: 0.2 !important;
}
.swiper-pagination-bullet-active {
  background: var(--accent-lime) !important;
  opacity: 1 !important;
  width: 20px !important;
  border-radius: 4px !important;
  transition: all 0.3s ease !important;
}

