/* CSS Variables */
:root {
  --font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
}

body {
  font-family: var(--font-body);
  background-color: #fafaf9; /* Stone 50 */
  color: #475569; /* Slate 600 */
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  /* Vietnamese Typography Optimization */
  line-height: 1.7;
  letter-spacing: 0.01em;
  font-variant-ligatures: common-ligatures;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  color: #0c0a09; /* Stone 950 */
}

/* Vietnamese Typography Utilities */
.vn-leading {
  line-height: 1.7;
}

.vn-spacing {
  letter-spacing: 0.01em;
}

/* Minimum readable font sizes for Vietnamese */
.vn-text-body {
  font-size: 1.125rem; /* 18px */
  line-height: 1.7;
}

.vn-text-meta {
  font-size: 1rem; /* 16px */
  line-height: 1.6;
}

.vn-text-label {
  font-size: 0.875rem; /* 14px */
  line-height: 1.5;
}

/* Smooth Dot Grid Background */
.bg-dot-grid {
  background-image: radial-gradient(#d6d3d1 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}

/* Modern Gradient Text */
.text-gradient-orange {
  background: linear-gradient(135deg, #ea580c 0%, #d97706 50%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% auto;
  animation: gradient-move 8s linear infinite;
}

@keyframes gradient-move {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Blob Animation */
@keyframes blob {
  0% {
    transform: translate(0px, 0px) scale(1);
  }
  33% {
    transform: translate(30px, -50px) scale(1.1);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
  100% {
    transform: translate(0px, 0px) scale(1);
  }
}

.animate-blob {
  animation: blob 10s infinite;
}

.animation-delay-2000 {
  animation-delay: 2s;
}
.animation-delay-4000 {
  animation-delay: 4s;
}

/* Card Hover Effects */
.hover-card-lift {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hover-card-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05),
    0 8px 10px -6px rgba(0, 0, 0, 0.01);
}

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

.animate-marquee {
  animation: marquee 30s linear infinite;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #fafaf9;
}
::-webkit-scrollbar-thumb {
  background: #d6d3d1;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #a8a29e;
}

::selection {
  background: #fdba74;
  color: #431407;
}

/* 3D Transform */
.perspective-container {
  perspective: 1200px;
  transform-style: preserve-3d;
}

.isometric-stack {
  transform-style: preserve-3d;
  transform: rotateX(10deg) rotateY(-10deg);
}

/* Layer animations */
@keyframes float-layer {
  0%,
  100% {
    transform: translateZ(0px) translateY(0px);
  }
  50% {
    transform: translateZ(10px) translateY(-8px);
  }
}

@keyframes float-layer-reverse {
  0%,
  100% {
    transform: translateZ(0px) translateY(0px);
  }
  50% {
    transform: translateZ(-5px) translateY(5px);
  }
}

.layer-back {
  animation: float-layer-reverse 6s ease-in-out infinite;
}
.layer-mid {
  animation: float-layer 5s ease-in-out infinite;
  animation-delay: 0.5s;
}
.layer-front {
  animation: float-layer 4s ease-in-out infinite;
  animation-delay: 1s;
}

/* Glowing effects */
@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(234, 88, 12, 0.2), 0 0 40px rgba(234, 88, 12, 0.1);
  }
  50% {
    box-shadow: 0 0 30px rgba(234, 88, 12, 0.4), 0 0 60px rgba(234, 88, 12, 0.2);
  }
}

.glow-orange {
  animation: pulse-glow 3s ease-in-out infinite;
}

/* Typing cursor */
@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

.cursor-blink {
  animation: blink 1s step-end infinite;
}

/* Floating badges */
@keyframes float-badge {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(2deg);
  }
}

.float-badge {
  animation: float-badge 3s ease-in-out infinite;
}

/* Shimmer effect */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.shimmer {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* Tech stack hover */
.tech-card {
  transition: all 0.3s ease;
}

.tech-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.1);
}

/* Gradient border animation */
@keyframes gradient-rotate {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.gradient-border {
  background: linear-gradient(90deg, #f97316, #eab308, #f59e0b, #f97316);
  background-size: 300% 100%;
  animation: gradient-rotate 4s ease infinite;
}

/* FAQ Accordion */
.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out, opacity 0.3s ease-out;
  opacity: 0;
}

.faq-content.faq-open {
  max-height: 1000px;
  opacity: 1;
}

/* ===================================================================
   NEURAL HUB SERVICES SECTION STYLES
   =================================================================== */

/* Ambient Background Grid - Dark dots on light bg */
#services .bg-grid {
  background-size: 40px 40px;
  background-image: radial-gradient(
    circle,
    rgba(0, 0, 0, 0.05) 1px,
    transparent 1px
  );
  mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
}

/* Glass Card Styling - Light Mode */
#services .glass-panel {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 2px 4px -1px rgba(0, 0, 0, 0.03);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#services .glass-panel:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(249, 115, 22, 0.3);
  box-shadow: 0 10px 30px -5px rgba(249, 115, 22, 0.15),
    0 4px 10px -2px rgba(0, 0, 0, 0.05);
  transform: translateY(-4px);
}

/* Fallback for browsers without backdrop-filter */
@supports not (backdrop-filter: blur()) {
  #services .glass-panel {
    background: rgba(255, 255, 255, 0.95);
  }
}

/* SVG Connection Lines */
#services .connection-path {
  fill: none;
  stroke: url(#gradientStroke);
  stroke-width: 2;
  stroke-dasharray: 6 6;
  opacity: 0.15;
  transition: opacity 0.3s;
}

#services .connection-active {
  opacity: 1;
  filter: drop-shadow(0 0 2px rgba(249, 115, 22, 0.4));
  animation: flow 1s linear infinite;
}

@keyframes flow {
  to {
    stroke-dashoffset: -12;
  }
}

/* Central Core Animation */
#services .core-glow {
  background: radial-gradient(
    circle,
    rgba(249, 115, 22, 0.25) 0%,
    rgba(249, 115, 22, 0) 70%
  );
  animation: pulse-core 4s ease-in-out infinite;
}

@keyframes pulse-core {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.1);
  }
}

/* Orbit Rings */
#services .orbit-ring {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#services .orbit-object {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  animation: spin linear infinite;
}

#services .orbit-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #f97316;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(249, 115, 22, 0.6);
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
}

@keyframes spin {
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Text Gradients */
#services .text-gradient-accent {
  background: linear-gradient(to right, #ea580c, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Layout Positioning (Desktop) */
#services .hub-wrapper {
  position: relative;
  width: 100%;
  max-width: 1200px;
  height: 750px;
  margin: 0 auto;
}

/* Node Positioning */
#services .node-pos {
  position: absolute;
  z-index: 20;
  width: 320px;
}

#services .node-1 {
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
}

#services .node-2 {
  top: 180px;
  right: 20px;
}

#services .node-3 {
  bottom: 180px;
  right: 20px;
}

#services .node-4 {
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
}

#services .node-5 {
  bottom: 180px;
  left: 20px;
}

#services .node-6 {
  top: 180px;
  left: 20px;
}

/* Responsive */
@media (max-width: 1024px) {
  #services .hub-wrapper {
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
  }

  #services .node-pos {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    width: 100%;
    max-width: 400px;
  }

  #services .connections-layer {
    display: none;
  }

  #services .ai-core-container {
    margin: 40px 0;
    order: -1;
  }
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
  #services .core-glow,
  #services .orbit-object,
  #services .connection-active {
    animation: none !important;
  }

  #services .glass-panel {
    transition: none !important;
  }
}

/* ============================================
   HEXAGON PARTNERS GRID
   ============================================ */
.hex-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 1000px;
  margin: 0 auto;
  padding-bottom: 60px;
}

.hex-wrapper {
  position: relative;
  width: 200px;
  height: 220px;
  margin: -25px 10px 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  filter: drop-shadow(0 4px 6px rgba(120, 113, 108, 0.03))
    drop-shadow(0 10px 15px rgba(120, 113, 108, 0.02));
  z-index: 1;
}

/* Stagger every even item for honeycomb on desktop */
@media (min-width: 768px) {
  .hex-wrapper:nth-child(even) {
    margin-top: 85px;
  }
  .hex-grid {
    padding-top: 40px;
  }
}

@media (max-width: 767px) {
  .hex-wrapper {
    margin: -15px 5px;
    transform: scale(0.9);
  }
  .hex-wrapper:nth-child(even) {
    margin-top: 0;
  }
}

.hex-wrapper:hover {
  z-index: 10;
  transform: translateY(-5px) scale(1.02);
  filter: drop-shadow(0 20px 25px rgba(234, 88, 12, 0.15));
}

/* Hexagon Shape Mask */
.hex-mask {
  width: 100%;
  height: 100%;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: linear-gradient(180deg, #ffffff 0%, #fafaf9 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Border simulation */
.hex-mask::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(145deg, #e7e5e4, #f5f5f4);
}

.hex-content {
  position: absolute;
  inset: 1px;
  background: #ffffff;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: background 0.3s ease;
}

/* Center Node Special Styling - Removed, now uses default styling */

/* Hover Effects */
.hex-wrapper:hover .hex-content {
  background: #fafaf9;
}

.hex-wrapper:hover .hex-icon-box {
  color: #ea580c;
  background: rgba(234, 88, 12, 0.05);
  transform: scale(1.1);
}

.hex-icon-box {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #78716c;
  margin-bottom: 12px;
  transition: all 0.3s ease;
}

.hex-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1c1917;
  margin-bottom: 4px;
  transition: color 0.3s;
}

.hex-subtitle {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a8a29e;
}
/* ============================================
   HEADER ANIMATIONS - FADE IN FROM BOTTOM
   ============================================ */

/* Keyframe for fade-in from bottom */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Initial state - hidden */
header.i18n-loading .header-logo,
header.i18n-loading nav a,
header.i18n-loading .header-actions > * {
  opacity: 0;
  transform: translateY(20px);
}

/* Animated state - visible with stagger */
header.i18n-ready .header-logo {
  animation: fadeInUp 0.6s ease-out forwards;
  animation-delay: 0.1s;
}

header.i18n-ready nav a:nth-child(1) {
  animation: fadeInUp 0.6s ease-out forwards;
  animation-delay: 0.15s;
}

header.i18n-ready nav a:nth-child(2) {
  animation: fadeInUp 0.6s ease-out forwards;
  animation-delay: 0.2s;
}

header.i18n-ready nav a:nth-child(3) {
  animation: fadeInUp 0.6s ease-out forwards;
  animation-delay: 0.25s;
}

header.i18n-ready nav a:nth-child(4) {
  animation: fadeInUp 0.6s ease-out forwards;
  animation-delay: 0.3s;
}

header.i18n-ready nav a:nth-child(5) {
  animation: fadeInUp 0.6s ease-out forwards;
  animation-delay: 0.35s;
}

header.i18n-ready .header-actions > *:nth-child(1) {
  animation: fadeInUp 0.6s ease-out forwards;
  animation-delay: 0.4s;
}

header.i18n-ready .header-actions > *:nth-child(2) {
  animation: fadeInUp 0.6s ease-out forwards;
  animation-delay: 0.45s;
}

header.i18n-ready .header-actions > *:nth-child(3) {
  animation: fadeInUp 0.6s ease-out forwards;
  animation-delay: 0.5s;
}

/* Mobile menu animations */
header.i18n-loading [data-mobile-menu] a {
  opacity: 0;
  transform: translateY(20px);
}

header.i18n-ready [data-mobile-menu] > div > a:nth-child(1) {
  animation: fadeInUp 0.5s ease-out forwards;
  animation-delay: 0.1s;
}

header.i18n-ready [data-mobile-menu] > div > a:nth-child(2) {
  animation: fadeInUp 0.5s ease-out forwards;
  animation-delay: 0.15s;
}

header.i18n-ready [data-mobile-menu] > div > a:nth-child(3) {
  animation: fadeInUp 0.5s ease-out forwards;
  animation-delay: 0.2s;
}

header.i18n-ready [data-mobile-menu] > div > a:nth-child(4) {
  animation: fadeInUp 0.5s ease-out forwards;
  animation-delay: 0.25s;
}

header.i18n-ready [data-mobile-menu] > div > a:nth-child(5) {
  animation: fadeInUp 0.5s ease-out forwards;
  animation-delay: 0.3s;
}

header.i18n-ready [data-mobile-menu] > div > a:nth-child(6) {
  animation: fadeInUp 0.5s ease-out forwards;
  animation-delay: 0.35s;
}

/* Prevent animation on page navigation (only on first load) */
header.i18n-ready.no-animation * {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}
