/* =========================
   Base + Design Tokens (RESTORED)
   ========================= */
:root {
  --bg-1: #001d2b;  /* brand deep */
  --bg-2: #001724;  
  --ink: #eaf2f6;   /* near-white on dark */
  --muted: #b9c7cf;
  --accent: #ffc819; /* warm gold */
  --card: #072033;
  --card-2: #0b2a40;
  --line: rgba(255, 255, 255, 0.1);
  --maxw: 1200px;
  --radius: 16px;
  --shadow-soft: 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.5;
  background: var(--bg-1);
  overflow-x: hidden;
  scroll-behavior: smooth;
  /* Improve animation performance */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }

.container { width: min(100% - 32px, var(--maxw)); margin-inline: auto; }

/* =========================
   Hero Section (RESTORED)
   ========================= */
.hero { 
  position: relative; 
  min-height: 100dvh; 
  display: grid; 
  place-items: center; 
  padding: 80px 0; 
  z-index: 0;
  background:
    radial-gradient(40vw 40vw at 15% 10%, rgba(255,255,255,0.08), transparent 60%),
    radial-gradient(50vw 50vw at 85% 0%, rgba(255,255,255,0.06), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2));
}
.hero-inner { text-align: center; max-width: 1000px; }
.eyebrow { display: inline-block; letter-spacing: .12em; text-transform: uppercase; font-size: 12px; color: var(--muted); border: 1px solid var(--line); padding: 8px 12px; border-radius: 999px; backdrop-filter: blur(4px); background: rgba(255,255,255,0.03); }
h1.hero-title { margin: 18px 0 16px; font-size: clamp(36px, 6vw, 64px); line-height: 1.1; font-weight: 900; letter-spacing: -.02em; }
.hero-sub { color: var(--muted); font-size: clamp(16px, 2.3vw, 20px); max-width: 900px; margin: 0 auto 28px; font-weight: 400; }
.cta { position: relative; display: inline-flex; align-items: center; gap: 10px; background: linear-gradient(180deg, #ffe38a, var(--accent)); color: #1a1a1a; font-weight: 700; padding: 14px 22px; border-radius: 4px; box-shadow: 0 10px 20px rgba(255,200,25,.2), inset 0 1px 0 rgba(255,255,255,.4); transition: transform .15s ease, box-shadow .2s ease; will-change: transform; }
.cta:hover { transform: translateY(-1px); box-shadow: 0 18px 30px rgba(255,200,25,.25), inset 0 1px 0 rgba(255,255,255,.5); }
.cta:active { transform: translateY(0); }
.cta::after { content: ""; position: absolute; left: 50%; transform: translateX(-50%); bottom: -28px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 6px rgba(255,200,25,.18), 0 0 20px rgba(255,200,25,.55); }

/* =========================
   Services + Animated Path (RESTORED)
   ========================= */
.services-wrap { position: relative; padding: 120px 0; }
.services-head { text-align: center; margin-bottom: 32px; font-weight: 900; }
.services-eyebrow { display: inline-block; letter-spacing: .12em; text-transform: uppercase; font-size: 12px; color: var(--muted); border: 1px solid var(--line); padding: 8px 12px; border-radius: 999px; backdrop-filter: blur(4px); background: rgba(255,255,255,0.03); }
.services-title { font-size: clamp(28px, 4vw, 42px); margin: 8px 0 0; }

#path-svg { position: absolute; left: 0; width: 100%; pointer-events: none; z-index: 0; }

/* Magnet-to-repeat connection SVG positioning */
#magnet-repeat-connection { 
  position: absolute; 
  left: 0; 
  top: 0;
  width: 100%; 
  height: 100%;
  pointer-events: none; 
  z-index: -1; /* Behind the circles so they're not struck through */
}

/* Magnet-to-repeat connection line styling */
#magnet-repeat-path {
  stroke: var(--accent);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px rgba(255,200,25,.25));
  opacity: 0;
  transition: opacity 0.5s ease;
}

#magnet-repeat-path.visible {
  opacity: 1;
}

#magnet-repeat-path.animating {
  /* Enable the gradual line drawing animation */
  opacity: 1;
  animation: drawMagnetRepeatLine 9s ease-out forwards;
}

@keyframes drawMagnetRepeatLine {
  to {
    stroke-dashoffset: 0;
  }
}
.flow-path { 
  stroke: var(--accent); 
  stroke-width: 4; 
  fill: none; 
  stroke-linecap: round; 
  stroke-linejoin: round; 
  filter: drop-shadow(0 0 8px rgba(255,200,25,.25)); 
  opacity: 0; 
  transition: opacity .3s ease, stroke-dashoffset 0.05s ease-out; /* Smoother line animation */
  /* Improve rendering performance */
  will-change: stroke-dashoffset, opacity;
  transform: translateZ(0);
}

.service-blocks { position: relative; z-index: 2; display: grid; gap: 28px; width: min(100% - 32px, 900px); margin: 0 auto; }

.services-footer { text-align: center; margin-top: 48px; }
.services-footer-text { color: var(--muted); font-size: 18px; line-height: 1.6; max-width: 800px; margin: 0 auto; font-style: italic; font-weight: 400; }

.block { position: relative; overflow: hidden; border-radius: var(--radius); background: linear-gradient(180deg, var(--card), var(--card-2)); border: 1px solid var(--line); box-shadow: var(--shadow-soft); padding: clamp(22px, 3vw, 32px) clamp(22px, 3vw, 32px) clamp(22px, 3vw, 28px) clamp(32px, 5vw, 48px); transition: border-color .25s ease, transform .25s ease; }
.block:hover { transform: translateY(-2px); }
.block.active { 
  border-color: rgba(255,200,25,.55); 
}
.block h3 { margin: 0 0 8px; font-size: clamp(22px, 3vw, 28px); letter-spacing: -0.01em; }
.block p { margin: 0; color: var(--muted); font-size: 18px; font-weight: 400; }

.node-pin { position: absolute; left: 16px; top: 28px; width: 10px; height: 10px; border-radius: 50%; background: transparent; outline: 10px solid transparent; box-shadow: 0 0 0 4px rgba(255,255,255,0.08) inset, 0 0 18px rgba(255,200,25,.25); }
.block.active .node-pin { background: var(--accent); box-shadow: 0 0 0 6px rgba(255,200,25,.28), 0 0 22px rgba(255,200,25,.6); }

/* Highlight AI block (visible, refined) */
.block.ai-highlight { 
  border-color: var(--accent); 
  box-shadow: 0 0 24px rgba(255,200,25,.45), 0 0 60px rgba(255,200,25,.20); 
}

/* Ensure AI box gets the same active state treatment as other boxes */
.block.ai-highlight .node-pin { 
  background: var(--accent); 
  box-shadow: 0 0 0 6px rgba(255,200,25,.28), 0 0 22px rgba(255,200,25,.6); 
}

/* Make sure AI box gets active state when it has both classes */
.block.active.ai-highlight {
  border-color: var(--accent);
}

/* Enhanced path visibility when active */
.flow-path[style*="opacity: 1"] {
  stroke-width: 5;
  filter: drop-shadow(0 0 12px rgba(255,200,25,.4));
}

/* Ensure path is visible during animation */
.flow-path.animating {
  opacity: 1 !important;
}

/* Debug: Make path more visible when active */
.flow-path[style*="opacity: 1"] {
  stroke-width: 6;
  filter: drop-shadow(0 0 16px rgba(255,200,25,.6));
}

/* Safari-specific fixes for line visibility */
@supports (-webkit-appearance: none) {
  .flow-path {
    /* Ensure line stays visible in Safari */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    /* Force hardware acceleration */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }
  
  /* Safari fix for stroke-dashoffset animation */
  .flow-path.animating {
    -webkit-animation: none !important;
    animation: none !important;
  }
}

/* =========================
   Tech Stack (RESTORED)
   ========================= */
.tech { position: relative; padding: 90px 0; border-top: 1px solid var(--line); }
.tech h2 { text-align: center; font-size: clamp(26px, 4vw, 36px); margin: 0 0 28px; }
.logos {
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 16px; width: min(100% - 32px, var(--maxw)); margin: 0 auto;
}
@media (max-width: 900px) { .logos { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 640px) { .logos { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.logo-card {
  display: grid; place-items: center; height: 96px; border-radius: 14px; border: 1px solid var(--line);
  color: var(--ink); font-weight: 700; letter-spacing: .02em; text-align: center;
}

/* =========================
   Client Showcase (RESTORED)
   ========================= */
.clients { position: relative; padding: 90px 0 120px; border-top: 1px solid var(--line); }
.clients h2 { text-align: center; font-size: clamp(26px, 4vw, 36px); margin: 0 0 28px; }
.client-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 18px; width: min(100% - 32px, var(--maxw)); margin: 0 auto;
}
@media (max-width: 900px) { .client-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 640px) { .client-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.client-card {
  height: 86px; border-radius: 14px; border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--muted); font-weight: 700;
}

/* =========================
   Holistic Approach Section
   ========================= */
.holistic { position: relative; padding: 120px 0 0; }
.holistic-head { text-align: center; margin-bottom: 32px; font-weight: 900; }
.holistic-head h2 { font-size: clamp(28px, 4vw, 42px); margin: 0 0 16px; }
.holistic-head p { color: var(--muted); font-size: 18px; max-width: 800px; margin: 0 auto; line-height: 1.6; font-weight: 400; }

.holistic-content { position: relative; }

/* Main container for the elements and SVG */
.main-content-container {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  width: 1250px;
  gap: 70px;
  padding: 32px 0 0;
  min-height: 500px;
  margin: 0 auto;
}

/* Container for each circle and its bullets */
.circle-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* Bullet points styling */
.circle-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: center;
  max-width: 200px;
}

.circle-bullets li {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 8px;
  font-weight: 400;
}

/* Custom styles for the circles */
.circle {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1rem;
  box-sizing: border-box;
  opacity: 0;
  transform: scale(0.8);
  animation: fadeInScale 1.0s ease-out forwards;
  animation-fill-mode: both;
  background: linear-gradient(180deg, var(--card), var(--card-2));
  color: var(--ink);
  font-weight: 500;
  font-size: 14px;
  line-height: 1.3;
  transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}

/* Circles are positioned by flexbox layout */

/* Active state for holistic circles */
.circle.active {
  border-color: rgba(255,200,25,.55);
  box-shadow: 0 0 24px rgba(255,200,25,.45), 0 0 60px rgba(255,200,25,.20);
  transform: scale(1.05);
}

/* Holistic node-pins glow when active (same as service blocks) */
.circle.active .node-pin,
#magnet-icon.active .node-pin,
#repeat-icon.active .node-pin {
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(255,200,25,.28), 0 0 22px rgba(255,200,25,.6);
}

/* Keyframes for the fade-in and scale-up animation */
@keyframes fadeInScale {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Styles for the start/finish icons */
.icon-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 150px; /* Match circle size for better balance */
  height: 150px; /* Keep height to match circles */
  flex-shrink: 0;
  opacity: 0;
  animation: fadeIn 1.0s ease-out forwards;
  animation-fill-mode: both;
  /* Ensure vertical centering with circles */
  align-self: center;
}



/* Position the starting magnet icon to the left of the first circle */
#magnet-icon {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

/* Override node-pin positioning for magnet-icon to center it like the emoji was */
#magnet-icon .node-pin {
  position: absolute; /* Position absolutely within the icon container */
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%); /* Center the pin perfectly */
  margin: 0; /* Remove margin since we're using transform */
}

/* Style for the magnet emoji (keeping for reference) */
.magnet-icon {
  font-size: 40px; /* Size for the magnet emoji */
  line-height: 1; /* Ensure proper vertical alignment */
  display: inline-block; /* Ensure transform applies correctly */
}

/* Position the ending repeat icon to the right of the last circle */
#repeat-icon {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

/* Override node-pin positioning for repeat-icon to center it like the emoji was */
#repeat-icon .node-pin {
  position: absolute; /* Position absolutely within the icon container */
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%); /* Center the pin perfectly */
  margin: 0; /* Remove margin since we're using transform */
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Styles for the animated dotted line */
.absolute-svg {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  overflow: visible;
  width: 100%;
  height: 100%;
}

.animated-dotted-path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 2 8;
  stroke-dashoffset: 0;
  animation: drawPath 1.5s linear forwards;
  stroke-linecap: round;
  stroke-opacity: 0.7;
  animation-fill-mode: both;
}

@keyframes drawPath {
  to {
    stroke-dashoffset: 0;
  }
}

/* Initial animation for elements (they'll be controlled by the main path) */
#magnet-icon { animation-delay: 0s; }
#circle1, #circle2, #circle3, #circle4 { animation-delay: 0.5s; }
#repeat-icon { animation-delay: 0.5s; }

/* =========================
   Logo Section
   ========================= */
.logo-section {
  position: relative;
  padding: 120px 0;
  min-height: 400px;
}

/* Combined container for holistic and logo sections */
.holistic-logo-container {
  position: relative;
  min-height: 100vh; /* Ensure container has proper height */
}



.logo-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 32px;
}

.centered-logo {
  width: 200px;
  height: 200px;
  opacity: 0.8;
  transition: opacity 0.3s ease;
  /* Ensure logo is visible */
  position: relative;
  z-index: 1;
  /* Ensure SVG displays properly */
  object-fit: contain;
}

.centered-logo:hover {
  opacity: 1;
}

/* Logo section content styling */
.logo-content {
  text-align: center;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* Two-column layout for logo description */
.logo-description-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  width: 100%;
  text-align: left;
}

.logo-description-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.logo-description-column p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
  margin: 0;
  font-weight: 400;
}

.logo-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
  margin: 0 0 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.logo-description {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
  margin: 0 0 32px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.logo-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, #ffe38a, var(--accent));
  color: #1a1a1a;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: 4px;
  box-shadow: 0 10px 20px rgba(255,200,25,.2), inset 0 1px 0 rgba(255,255,255,.4);
  transition: transform .15s ease, box-shadow .2s ease;
  will-change: transform;
}

.logo-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 30px rgba(255,200,25,.25), inset 0 1px 0 rgba(255,255,255,.5);
}

.logo-cta:active {
  transform: translateY(0);
}

/* =========================
   Client Logo Carousel
   ========================= */
.client-carousel-section {
  position: relative;
  padding: 120px 0;
  overflow: hidden;
}

.carousel-header {
  text-align: center;
  margin-bottom: 60px;
}

.carousel-header h2 {
  font-size: clamp(28px, 4vw, 42px);
  margin: 0 0 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.carousel-header p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
  margin: 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  font-weight: 400;
}

.logo-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 20px 0;
}

.carousel-track {
  display: flex;
  animation: scrollLogos 30s linear infinite;
  width: max-content;
}

.logo-item {
  flex-shrink: 0;
  margin: 0 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 80px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.3s ease;
}

.logo-item:hover {
  border-color: rgba(255, 200, 25, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.client-logo {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  filter: grayscale(100%) brightness(0.8);
  transition: all 0.3s ease;
  opacity: 0.7;
}

.logo-item:hover .client-logo {
  filter: grayscale(0%) brightness(1);
  opacity: 1;
}

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

/* Pause animation on hover */
.logo-carousel:hover .carousel-track {
  animation-play-state: paused;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .client-carousel-section { padding: 80px 0; }
  .carousel-header h2 { font-size: 2.5rem; }
  .carousel-header p { font-size: 1rem; }
  .logo-item { 
    width: 100px; 
    height: 70px; 
    margin: 0 20px; 
  }
  .logo-description-columns {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .logo-description-column p {
    font-size: 16px;
  }
}

@media (max-width: 768px) {
  .services-wrap { padding: 80px 0; }
  .holistic { padding: 80px 0; }
  .logo-section { padding: 80px 0; }
  .holistic-head h2 { font-size: 2.5rem; }
  .holistic-head p { font-size: 1rem; }
  .main-content-container {
    width: 100%;
    flex-direction: column;
    gap: 40px;
    min-height: auto;
    align-items: center;
  }
  .circle-container {
    gap: 20px;
    width: 100%;
    max-width: 300px;
  }
  .circle {
    width: 120px;
    height: 120px;
    font-size: 16px;
  }
  .icon-container {
    width: 120px;
    height: 120px;
  }
  .circle-bullets {
    max-width: 280px;
  }
  .circle-bullets li {
    font-size: 15px;
    margin-bottom: 10px;
  }
  .animated-dotted-path, .absolute-svg {
    display: none;
  }
  /* Hide the magnet-to-repeat connection line on mobile */
  #magnet-repeat-connection {
    display: none;
  }
  /* Hide the magnet and repeat icons on mobile */
  #magnet-icon, #repeat-icon {
    display: none;
  }
}



/* Responsive adjustments */
@media (max-width: 1280px) {
  .main-content-container {
    width: 100%;
    max-width: 1100px;
    gap: 30px;
  }
}



@media (max-width: 480px) {
  .holistic-head h2 { font-size: 2rem; }
  .holistic-head p { font-size: 0.9rem; }
  .circle {
    width: 80px;
    height: 80px;
  }
  .icon-container {
    width: 80px;
    height: 80px;
  }
}

/* Footer */
footer { color: var(--muted); font-size: 14px; padding: 24px 0 60px; text-align: center; font-weight: 400; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .flow-path { stroke-dasharray: none !important; stroke-dashoffset: 0 !important; opacity: 1; }
}
