/* ==========================================================================
   ASDM (Asesoría en Soluciones Digitales Molina) - Design System & Dynamic Engine
   Theme: High-Performance Dark 3D Aesthetic (#0C0C0C)
   Typography: 'Kanit', sans-serif (Weights 300 - 900)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Kanit:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,300;1,400;1,600&display=swap');

:root {
  --bg-dark: #0C0C0C;
  --bg-white: #FFFFFF;
  --text-main: #D7E2EA;
  --text-muted: #8E9BA6;
  --accent-cyan: #00B4D8;
  --accent-orange: #F26419;
  --font-family: 'Kanit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Global Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-family);
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-family);
  overflow-x: clip;
  min-height: 100vh;
  position: relative;
}

#root, .main-wrapper {
  background-color: var(--bg-dark);
  overflow-x: clip;
  width: 100%;
  position: relative;
}

/* Selection */
::selection {
  background: #B600A8;
  color: #FFFFFF;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #0C0C0C;
}
::-webkit-scrollbar-thumb {
  background: #23272F;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3B4252;
}

/* ==========================================================================
   Typography & Hero Heading
   ========================================================================== */
.hero-heading {
  background: linear-gradient(180deg, #646973 0%, #BBCCD7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
}

.hero-heading-cyan {
  background: linear-gradient(180deg, #FFFFFF 0%, #00B4D8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

/* Reusable Contact Button - ASDM Electric Cyan & Cobalt Navy Brand Palette */
.btn-contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  border-radius: 9999px;
  background: linear-gradient(125deg, #0A1E3F 0%, #1A4B8F 38%, #0077B6 72%, #00B4D8 100%);
  box-shadow: 0px 4px 20px rgba(0, 180, 216, 0.35), inset 2px 2px 8px rgba(255, 255, 255, 0.3);
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: -3px;
  color: #FFFFFF;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.75rem 2rem;
  font-size: 0.875rem;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, filter 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

@media (min-width: 640px) {
  .btn-contact {
    padding: 0.875rem 2.5rem;
    font-size: 0.95rem;
  }
}

@media (min-width: 768px) {
  .btn-contact {
    padding: 1rem 3rem;
    font-size: 1rem;
  }
}

.btn-contact:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0px 8px 30px rgba(0, 180, 216, 0.6), inset 2px 2px 12px rgba(255, 255, 255, 0.45);
  filter: brightness(1.15);
}

.btn-contact:active {
  transform: translateY(0) scale(0.98);
}

/* Reusable Live Project / Ghost Button */
.btn-live-project {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 9999px;
  border: 2px solid #D7E2EA;
  color: #D7E2EA;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 0.75rem 2rem;
  font-size: 0.875rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

@media (min-width: 640px) {
  .btn-live-project {
    padding: 0.875rem 2.5rem;
    font-size: 1rem;
  }
}

.btn-live-project:hover {
  background-color: rgba(215, 226, 234, 0.12);
  border-color: #FFFFFF;
  color: #FFFFFF;
  transform: translateY(-2px);
}

/* ==========================================================================
   Magnet Physics Container
   ========================================================================== */
.magnet-wrapper {
  display: inline-block;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.magnet-wrapper.is-active {
  transition: transform 0.2s cubic-bezier(0.2, 0, 0.2, 1);
}

/* ==========================================================================
   Marquee Infinite & Autonomous Continuous Physics (Zero Scroll Dependency)
   ========================================================================== */
.marquee-track {
  display: flex;
  gap: 0.75rem; /* gap-3 = 12px exact */
  width: max-content;
  will-change: transform;
  backface-visibility: hidden;
}

#marquee-row-1 {
  animation: marqueeRight 65s linear infinite;
}

#marquee-row-2 {
  animation: marqueeLeft 65s linear infinite;
}

#marquee-row-1:hover,
#marquee-row-2:hover {
  animation-play-state: paused;
}

@keyframes marqueeLeft {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

@keyframes marqueeRight {
  0% {
    transform: translate3d(-50%, 0, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

.marquee-card {
  width: 300px;
  height: 195px;
  flex-shrink: 0;
  border-radius: 1rem; /* exact rounded-2xl as in reference */
  overflow: hidden;
  position: relative;
  background: #11141B;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  cursor: pointer;
  display: block;
}

@media (min-width: 640px) {
  .marquee-card {
    width: 360px;
    height: 230px;
  }
}

@media (min-width: 1024px) {
  .marquee-card {
    width: 420px;
    height: 270px;
  }
}

.marquee-card:hover {
  transform: scale(1.025);
  box-shadow: 0 15px 35px rgba(0, 180, 216, 0.25);
}

.marquee-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
}

/* Hover overlay tag with real brand link */
.marquee-card .brand-hover-badge {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  padding: 0.6rem 1rem;
  border-radius: 9999px;
  background: rgba(12, 12, 12, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  z-index: 10;
}

.marquee-card:hover .brand-hover-badge {
  opacity: 1;
  transform: translateY(0);
}

/* Brand Card Custom Accents */
.brand-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background-color: #10B981;
  box-shadow: 0 0 10px #10B981;
  animation: pulseLive 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulseLive {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Hero Cybernetic Halo & Pedestal for ASDM Emblem */
.hero-emblem-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
}

.hero-emblem-pedestal {
  position: absolute;
  width: 120%;
  height: 60%;
  bottom: -10%;
  left: -10%;
  background: radial-gradient(ellipse at center, rgba(0, 180, 216, 0.35) 0%, rgba(26, 75, 143, 0.2) 45%, transparent 75%);
  filter: blur(40px);
  pointer-events-none;
  z-index: 0;
}

.hero-circuit-ring {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 9999px;
  border: 1px dashed rgba(0, 180, 216, 0.25);
  animation: rotateCircuit 35s linear infinite;
  pointer-events-none;
}

@keyframes rotateCircuit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Animated Text (Character-by-character scroll opacity reveal)
   ========================================================================== */
.scroll-reveal-text {
  position: relative;
  line-height: 1.6;
  max-width: 720px;
  margin: 0 auto;
}

.char-reveal {
  display: inline-block;
  opacity: 0.2;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s ease;
  will-change: opacity;
}

.char-reveal.revealed {
  opacity: 1;
}

/* ==========================================================================
   Sticky Stacking Cards System
   ========================================================================== */
.stacking-section {
  position: relative;
  padding-bottom: 12rem !important;
}

@media (min-width: 768px) {
  .stacking-section {
    padding-bottom: 18rem !important;
  }
}

.stack-card-outer {
  position: sticky;
  top: 6rem;
  height: 85vh;
  margin-bottom: 2rem;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  perspective: 1000px;
}

.stack-card-outer:last-of-type {
  margin-bottom: 8rem;
}

@media (min-width: 768px) {
  .stack-card-outer {
    top: 7.5rem;
  }
}

.stack-card-inner {
  width: 100%;
  max-width: 1180px;
  background-color: #0C0C0C;
  border: 2px solid #D7E2EA;
  border-radius: 40px;
  padding: 1.5rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), filter 0.25s ease;
  transform-origin: center top;
  will-change: transform;
}

@media (min-width: 640px) {
  .stack-card-inner {
    border-radius: 50px;
    padding: 2rem;
  }
}

@media (min-width: 1024px) {
  .stack-card-inner {
    border-radius: 60px;
    padding: 2.75rem;
  }
}

/* Metodología Wipe Overlay - Prevents overlapping with Sticky Stacking Cards */
#metodologia {
  position: relative;
  z-index: 30;
  background-color: #0C0C0C;
  box-shadow: 0 -30px 60px rgba(0, 0, 0, 0.95);
}

/* ==========================================================================
   Fade In & Stagger Transitions
   ========================================================================== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.1, 0.25, 1), transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: opacity, transform;
}

.fade-in.is-in-view {
  opacity: 1;
  transform: translateY(0) translateX(0) !important;
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.9s cubic-bezier(0.25, 0.1, 0.25, 1), transform 0.9s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.9s cubic-bezier(0.25, 0.1, 0.25, 1), transform 0.9s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ==========================================================================
   Form Inputs & Glassmorphism
   ========================================================================== */
.glass-panel {
  background: rgba(18, 20, 26, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(215, 226, 234, 0.12);
}

input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px #15181E inset !important;
  -webkit-text-fill-color: #D7E2EA !important;
}

/* Floating animation for 3D elements */
@keyframes floatGentle {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-12px) rotate(2deg);
  }
}

.floating-3d {
  animation: floatGentle 6s ease-in-out infinite;
  pointer-events: none;
}
