:root {
  --kernel-red: #000000;
  --kernel-black: #000000;
  --kernel-white: #FFFFFF;
  --kernel-gray: #F8F9FA;
  --kernel-dark-gray: #6C757D;
  --kernel-light-gray: #E9ECEF;
  --kernel-blue: #007BFF;
  --kernel-green: #28A745;
  --kernel-yellow: #FFC107;
  --kernel-orange: #fd8924;
}

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  scroll-snap-type: y mandatory;
  overflow-y: scroll;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Inter", sans-serif;
  background: #02030a;
  color: #f9fbff;
  scroll-snap-type: y mandatory;
  overflow-y: scroll;
}

#root {
  min-height: 60vh;
  scroll-snap-align: start;
}

.hero-root {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 80px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  overflow: hidden;
  background: #02030a;
}

.hero-root h1 {
  position: absolute;
  z-index: 1;
  width: 100%;
  text-align: center;
  top: 28%;
  transform: translateY(-50%);
  background: linear-gradient(
    180deg,
    rgba(255,255,255,1) 0%,
    rgba(255,255,255,0.9) 70%,
    rgba(253, 137, 36, 0.4) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: clamp(3.5rem, 7vw, 7rem);
  font-weight: 700;
  line-height: 1.5;
  filter: drop-shadow(0 0 20px rgba(253, 137, 36, 0.1));
}
.hero-root h2 {
  position: absolute;
  z-index: 1;
  width: 100%;
  text-align: center;
  top: 39%;
  transform: translateY(-50%);
  background: linear-gradient(
    180deg,
    rgba(255,255,255,1) 0%,
    rgba(255,255,255,0.9) 70%,
    rgba(253, 137, 36, 0.4) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 300;
  line-height: 1;
  filter: drop-shadow(0 0 20px rgba(253, 137, 36, 0.1));
}

.hero-cta {
  position: absolute;
  z-index: 1;
  width: 100%;
  text-align: center;
  top: 80%;
  transform: translateY(-50%);
}

.glass-button {
  display: inline-block;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: rgba(255,255,255,0.95);
  background: rgba(253, 137, 36, 0.15);
  border: 2px solid rgba(253, 137, 36, 0.4);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 8px 32px rgba(253, 137, 36, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.glass-button:hover {
  background: rgba(253, 137, 36, 0.25);
  border-color: rgba(253, 137, 36, 0.6);
  box-shadow:
    0 8px 32px rgba(253, 137, 36, 0.2),
    0 0 20px rgba(253, 137, 36, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.glass-button:active {
  transform: translateY(0);
}

.hero-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.hero-band,
.hero-lines-group,
.hero-line {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}

.hero-layer--center {
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 42%,
    black 42%,
    black 56%,
    transparent 56%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 47%,
    black 47%,
    black 67%,
    transparent 67%,
    transparent 100%
  );
}

.hero-layer--top {
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 22%,
    black 24%,
    black 34%,
    transparent 36%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 40%,
    black 40%,
    black 47%,
    transparent 47%,
    transparent 100%
  );
}

.hero-layer--bottom {
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 54%,
    black 54%,
    black 60%,
    transparent 60%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 67%,
    black 67%,
    black 73%,
    transparent 75%,
    transparent 100%
  );
}

.hero-band {
  /* very soft horizontal glow behind everything */
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(170, 92, 33, .1) 5%,
    rgba(170, 92, 33, .2) 30%,
    rgba(191, 105, 39, .5) 50%,
    rgba(243, 109, 6, 0.2) 70%,
    rgba(170, 92, 33, .1) 5%,
    transparent 100%
  );
  opacity: 0.4;
}

.hero-line {
  /* full-width line we slide across the viewport */
  left: 0;
  width: 200vw; /* 2x viewport width, so center can align with each edge */
  transform-origin: 100% 50%; /* pivot toward the right so angles converge there */
  /* base gradients; actual thickness & vertical position are inline styles */
  background:
    /* horizontal gradient: denser glow in the middle, softer at ends */
    linear-gradient(
      90deg,
      rgba(0, 0, 0, 0) 0%,
      rgba(220, 116, 26, 0.25) 45%,
      rgba(253, 137, 36, 1) 50%,
      rgba(212, 112, 25, 0.25) 55%,
      rgba(0, 0, 0, 0) 100%
    ),
    /* vertical gradient: softer at top/bottom, denser in center of the line */
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0) 30%,
      rgba(197, 104, 23, 0.1) 40%,
      rgba(231, 135, 52, 1) 50%,
      rgba(197, 104, 23, 0.1) 60%,
      rgba(0, 0, 0, 0) 70%
    );
  box-shadow:
    0 0 2px rgba(231, 135, 52, 0.55),
    0 0 4px rgba(0, 0, 0, 0.9);
}

@media (prefers-reduced-motion: reduce) {
  .hero-band,
  .hero-lines-group,
  .hero-line {
    animation: none !important;
    transform: none !important;
  }
}

.features-section {
  height: 800vh;
  background: #ffffff;
  position: relative;
  scroll-snap-align: start;
}

.features-container {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding-top: 80px;
}

.features-track {
  display: flex;
  flex-direction: row;
  position: absolute;
  left: 0;
  height: 100%;
  transition: transform 0.3s ease-out;
  will-change: transform;
}

.feature-slide {
  min-width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  perspective: 2000px;
  flex-shrink: 0;
}

.feature-card {
  width: 90%;
  max-width: 1200px;
  height: 60vh;
  background: rgba(2, 3, 10, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(253, 137, 36, 0.2);
  border-radius: 24px;
  display: flex;
  overflow: hidden;
  box-shadow:
    0 20px 60px rgba(253, 137, 36, 0.3),
    0 0 100px rgba(253, 137, 36, 0.4),
    0 0 150px rgba(253, 137, 36, 0.2);
  transition: transform 0.6s ease, opacity 0.6s ease, box-shadow 0.6s ease;
}

.feature-card-left {
  flex: 1;
  padding: 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.5rem;
}

.feature-card-left h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  color: rgba(255, 255, 255, 0.95);
  font-weight: 700;
  line-height: 1.2;
}

.feature-card-left p {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.8;
}

.feature-card-right {
  flex: 1;
  background: rgba(253, 137, 36, 0.08);
  border-left: 1px solid rgba(253, 137, 36, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.feature-card-right-placeholder {
  width: 100%;
  height: 100%;
  border: 2px dashed rgba(253, 137, 36, 0.4);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(253, 137, 36, 0.7);
  font-size: 1rem;
}

/* 3D Carousel effect */
.feature-slide:not(.active) .feature-card {
  transform: scale(0.85) rotateY(5deg);
  opacity: 0.4;
  box-shadow:
    0 10px 30px rgba(253, 137, 36, 0.15),
    0 0 50px rgba(253, 137, 36, 0.2);
}

.feature-slide.active .feature-card {
  transform: scale(1) rotateY(0deg);
  opacity: 1;
  box-shadow:
    0 20px 60px rgba(253, 137, 36, 0.4),
    0 0 120px rgba(253, 137, 36, 0.5),
    0 0 180px rgba(253, 137, 36, 0.3);
}

.kernel-header {
  background: #02030a;
  color: var(--kernel-white);
  padding: 1rem 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kernel-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.kernel-logo img {
  height: 60px;
}

.kernel-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  justify-content: center;
}

.kernel-logo-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--kernel-white);
  text-decoration: none;
}

.kernel-logo-subtitle {
  font-size: 1rem;
  color: #6a6a6a;
  margin-top: -5px;
}

.navbar-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.navbar-nav {
  display: flex;
  list-style: none;
  gap: 2.5rem;
  margin: 0;
  padding: 0;
}

.nav-item {
  display: inline-block;
  position: relative;
}

.nav-link {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.3s ease;
  cursor: pointer;
  display: inline-block;
  padding-bottom: 4px;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(253, 137, 36, 1), transparent);
  box-shadow: 0 0 8px rgba(253, 137, 36, 0.6);
  transition: width 0.3s ease;
}

.nav-link:hover {
  color: rgba(255,255,255,1);
}

.nav-link:hover::after {
  width: 100%;
}

.language-selector {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.lang-option {
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.3s ease;
  padding: 4px 8px;
  border-radius: 4px;
}

.lang-option:hover {
  color: rgba(255,255,255,0.9);
}

.lang-option.active {
  color: rgba(253, 137, 36, 1);
  font-weight: 600;
}

.lang-divider {
  color: rgba(255,255,255,0.3);
}

.why-section {
  min-height: 100vh;
  background: #02030a;
  padding: 48px 48px;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
}

.how-section {
  min-height: 75vh;
  background: #ffffff;
  scroll-snap-align: start;
  padding-top: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.how-workflow {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.workflow-step {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  position: relative;
  opacity: 0;
  animation: fadeInStep 0.6s ease-out forwards;
  transition: transform 0.3s ease;
}

.workflow-step[data-step="1"] {
  animation-delay: 0.1s;
}

.workflow-step[data-step="2"] {
  animation-delay: 0.2s;
}

.workflow-step[data-step="3"] {
  animation-delay: 0.3s;
}

.workflow-step[data-step="4"] {
  animation-delay: 0.4s;
}

.workflow-step[data-step="5"] {
  animation-delay: 0.5s;
}

@keyframes fadeInStep {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.step-icon {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: 50%;
  background: rgba(253, 137, 36, 0.1);
  border: 2px solid rgba(253, 137, 36, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fd8924;
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
}

.step-icon svg {
  width: 28px;
  height: 28px;
}

.workflow-step:hover .step-icon {
  background: rgba(253, 137, 36, 0.2);
  border-color: rgba(253, 137, 36, 0.6);
  box-shadow: 0 0 20px rgba(253, 137, 36, 0.3);
  transform: scale(1.05);
}

.step-content {
  flex: 1;
  padding-bottom: 3rem;
}

.step-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.9);
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
}

.step-content p {
  font-size: 0.95rem;
  color: rgba(0, 0, 0, 0.6);
  line-height: 1.6;
}

.workflow-step:hover .step-content h3 {
  color: #fd8924;
}

.step-connector {
  position: absolute;
  left: 27px;
  top: 56px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    to bottom,
    rgba(253, 137, 36, 0.3) 0%,
    rgba(253, 137, 36, 0.1) 100%
  );
  z-index: 1;
}

.workflow-step[data-step="5"] .step-connector {
  display: none;
}

/* Animated pulse on connector */
.step-connector::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fd8924;
  animation: pulseDown 2s ease-in-out infinite;
}

@keyframes pulseDown {
  0% {
    top: 0;
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

/* Responsive workflow */
@media (max-width: 768px) {
  .how-workflow {
    max-width: 100%;
    padding: 0 1rem;
  }

  .step-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
  }

  .step-icon svg {
    width: 24px;
    height: 24px;
  }

  .step-connector {
    left: 23px;
    top: 48px;
  }

  .step-content h3 {
    font-size: 1.1rem;
  }

  .step-content p {
    font-size: 0.9rem;
  }
}

.section-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section-heading {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
}

.why-section .section-heading {
  color: rgba(255, 255, 255, 0.95);
}

.how-section .section-heading {
  color: rgba(0, 0, 0, 0.9);
}

.why-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  width: 100%;
  max-width: 1200px;
}

.why-card {
  background: rgba(255, 255, 255, 1);
  border: none;
  border-radius: 16px;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.3s ease;
  box-shadow:
    0 4px 20px rgba(253, 137, 36, 0.3),
    0 0 60px rgba(253, 137, 36, 0.25),
    0 0 100px rgba(253, 137, 36, 0.15);
}

.why-card:hover {
  box-shadow:
    0 8px 32px rgba(253, 137, 36, 0.4),
    0 0 80px rgba(253, 137, 36, 0.35),
    0 0 120px rgba(253, 137, 36, 0.25);
  transform: translateY(-4px);
}

.why-card-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(253, 137, 36, 0.1), rgba(253, 137, 36, 0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: rgba(253, 137, 36, 1);
  font-weight: 300;
}

.why-card-icon svg {
  width: 32px;
  height: 32px;
  color: rgba(253, 137, 36, 1);
  stroke: currentColor;
}

.why-card h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.9);
}

.why-card p {
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(0, 0, 0, 0.7);
}

.cta-section {
  min-height: 20vh;
  background: #ffffff;
  padding-bottom: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;
}

.cta-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.cta-heading {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: rgba(0, 0, 0, 0.9);
  text-align: center;
}

.cta-button {
  display: inline-block;
  padding: 1rem 3rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(253, 137, 36, 0.5);
  border: 2px solid rgba(253, 137, 36, 1);
  border-radius: 12px;
  box-shadow:
    0 8px 32px rgba(253, 137, 36, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.cta-button:hover {
  background: rgba(253, 137, 36, .8);
  border-color: rgba(253, 137, 36, 1);
  box-shadow:
    0 8px 32px rgba(253, 137, 36, 0.4),
    0 0 20px rgba(253, 137, 36, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

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

.footer {
  background: #000000;
  color: rgba(255, 255, 255, 0.7);
  padding: 3rem 24px 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-logo-img {
  height: 50px;
}

.footer-logo-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.footer-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
}

.footer-tagline {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
}

.footer-right {
  display: flex;
  gap: 2rem;
}

.footer-link {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: rgba(253, 137, 36, 1);
}

.footer-copyright {
  text-align: center;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
}

/* Data Overlap Diagram Styles */
.data-overlap-diagram {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
  padding: 2rem;
}

.overlap-svg {
  width: 100%;
  height: auto;
  max-width: 600px;
  transform-style: preserve-3d;
  transform: rotateX(5deg) rotateY(-5deg);
  transition: transform 0.6s ease;
  filter: drop-shadow(0 10px 30px rgba(253, 137, 36, 0.2));
}

.data-overlap-diagram:hover .overlap-svg {
  transform: rotateX(0deg) rotateY(0deg) scale(1.02);
  filter: drop-shadow(0 15px 40px rgba(253, 137, 36, 0.3));
}

/* Grid 3D Animation */
.grid-3d {
  animation: gridPulse 4s ease-in-out infinite;
}

@keyframes gridPulse {
  0%, 100% {
    opacity: 0.2;
  }
  50% {
    opacity: 0.35;
  }
}

/* Synthetic Layer Animations */
.synthetic-layer .synth-fill {
  transition: opacity 0.4s ease;
}

.synthetic-layer .synth-line {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawLine 3s ease-out forwards, pulseOrange 3s ease-in-out infinite;
  animation-delay: 0s, 3s;
}

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

@keyframes pulseOrange {
  0%, 100% {
    stroke-width: 3;
    opacity: 1;
  }
  50% {
    stroke-width: 3.5;
    opacity: 0.8;
  }
}

/* Original Layer Animations */
.original-layer .original-line {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawLine 3s ease-out forwards, pulseBlack 3s ease-in-out infinite;
  animation-delay: 0.3s, 3.3s;
}

@keyframes pulseBlack {
  0%, 100% {
    stroke-width: 3;
    opacity: 1;
  }
  50% {
    stroke-width: 3.5;
    opacity: 0.7;
  }
}

/* Data Points Animation */
.data-point {
  opacity: 0;
  animation: fadeInPoint 0.5s ease-out forwards, floatPoint 2s ease-in-out infinite;
  animation-delay: calc(var(--point-index, 0) * 0.2s + 2s), calc(var(--point-index, 0) * 0.2s + 3s);
  transition: r 0.3s ease, opacity 0.3s ease;
}

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

@keyframes floatPoint {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.data-overlap-diagram:hover .data-point {
  r: 6;
  cursor: pointer;
}

/* Synthetic data points */
.synthetic-layer .data-point:nth-child(3) {
  --point-index: 0;
}
.synthetic-layer .data-point:nth-child(4) {
  --point-index: 1;
}
.synthetic-layer .data-point:nth-child(5) {
  --point-index: 2;
}
.synthetic-layer .data-point:nth-child(6) {
  --point-index: 3;
}
.synthetic-layer .data-point:nth-child(7) {
  --point-index: 4;
}
.synthetic-layer .data-point:nth-child(8) {
  --point-index: 5;
}
.synthetic-layer .data-point:nth-child(9) {
  --point-index: 6;
}

/* Original data points */
.original-layer .data-point:nth-child(3) {
  --point-index: 0;
}
.original-layer .data-point:nth-child(4) {
  --point-index: 1;
}
.original-layer .data-point:nth-child(5) {
  --point-index: 2;
}
.original-layer .data-point:nth-child(6) {
  --point-index: 3;
}
.original-layer .data-point:nth-child(7) {
  --point-index: 4;
}
.original-layer .data-point:nth-child(8) {
  --point-index: 5;
}
.original-layer .data-point:nth-child(9) {
  --point-index: 6;
}

/* Legend Styles */
.legend text {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.5px;
}

/* Overlap Indicator - Show on hover */
.data-overlap-diagram:hover .overlap-indicator {
  opacity: 1 !important;
  animation: fadeInIndicator 0.5s ease-out;
}

@keyframes fadeInIndicator {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.overlap-indicator text {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.5px;
}

/* Fills hover effect */
.data-overlap-diagram:hover .synth-fill {
  opacity: 0.7;
}

.data-overlap-diagram:hover .original-fill {
  opacity: 0.5;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .data-overlap-diagram {
    padding: 1rem;
  }

  .overlap-svg {
    transform: rotateX(3deg) rotateY(-3deg);
  }

  .data-overlap-diagram:hover .overlap-svg {
    transform: rotateX(0deg) rotateY(0deg) scale(1.01);
  }
}

/* Correlation Heatmap Diagram Styles */
.correlation-diagram {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem;
  perspective: 1500px;
}

.heatmap-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transform-style: preserve-3d;
}

.heatmap-title {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  border: 1px solid rgba(253, 137, 36, 0.2);
  transform-style: preserve-3d;
  transform: rotateX(10deg) rotateY(-10deg);
  transition: transform 0.6s ease;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.5),
    0 0 50px rgba(253, 137, 36, 0.1);
}

.heatmap-container:hover .heatmap-grid {
  transform: rotateX(0deg) rotateY(0deg);
  box-shadow:
    0 15px 40px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(253, 137, 36, 0.2);
}

.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  position: relative;
  transform-style: preserve-3d;
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: transparent;
  opacity: 0;
  animation: fadeInCell 0.4s ease-out forwards;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.3),
    inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.heatmap-cell::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.2) 0%,
    rgba(255, 255, 255, 0) 50%,
    rgba(0, 0, 0, 0.2) 100%
  );
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.heatmap-cell:hover {
  transform: translateZ(20px) scale(1.1);
  box-shadow:
    0 8px 16px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(253, 137, 36, 0.4),
    inset 0 1px 1px rgba(255, 255, 255, 0.2);
  z-index: 10;
  color: rgba(255, 255, 255, 0.9);
}

.heatmap-cell:hover::before {
  opacity: 1;
}

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

/* Color variations for correlation values */
.heatmap-cell[data-value="low"] {
  background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
  animation-delay: calc(var(--cell-index) * 0.03s);
}

.heatmap-cell[data-value="medium-low"] {
  background: linear-gradient(135deg, #3d2414 0%, #2d1a0f 100%);
  animation-delay: calc(var(--cell-index) * 0.03s);
}

.heatmap-cell[data-value="medium"] {
  background: linear-gradient(135deg, #6b3e1a 0%, #5a3216 100%);
  animation-delay: calc(var(--cell-index) * 0.03s);
}

.heatmap-cell[data-value="medium-high"] {
  background: linear-gradient(135deg, #a85e1f 0%, #8a4d1a 100%);
  animation-delay: calc(var(--cell-index) * 0.03s);
}

.heatmap-cell[data-value="high"] {
  background: linear-gradient(135deg, #fd8924 0%, #e57a20 100%);
  animation-delay: calc(var(--cell-index) * 0.03s);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.3),
    0 0 10px rgba(253, 137, 36, 0.3),
    inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.heatmap-cell[data-value="diagonal"] {
  background: linear-gradient(135deg, #fd8924 0%, #ff9d3d 100%);
  animation-delay: calc(var(--cell-index) * 0.03s);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.3),
    0 0 15px rgba(253, 137, 36, 0.5),
    inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

/* Pulsing effect for diagonal cells */
.heatmap-cell[data-value="diagonal"] {
  animation: fadeInCell 0.4s ease-out forwards, pulseDiagonal 2s ease-in-out infinite;
  animation-delay: calc(var(--cell-index) * 0.03s), calc(var(--cell-index) * 0.03s + 1.5s);
}

@keyframes pulseDiagonal {
  0%, 100% {
    box-shadow:
      0 2px 4px rgba(0, 0, 0, 0.3),
      0 0 15px rgba(253, 137, 36, 0.5),
      inset 0 1px 1px rgba(255, 255, 255, 0.3);
  }
  50% {
    box-shadow:
      0 2px 4px rgba(0, 0, 0, 0.3),
      0 0 25px rgba(253, 137, 36, 0.7),
      inset 0 1px 1px rgba(255, 255, 255, 0.3);
  }
}

/* Divider between heatmaps */
.heatmap-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: fadeInDivider 0.8s ease-out forwards;
  animation-delay: 0.8s;
}

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

.heatmap-divider svg text {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 600;
}

/* Responsive adjustments for correlation diagram */
@media (max-width: 1024px) {
  .correlation-diagram {
    flex-direction: column;
    gap: 2rem;
  }

  .heatmap-divider svg {
    transform: rotate(90deg);
  }

  .heatmap-grid {
    transform: rotateX(5deg) rotateY(-5deg);
  }
}

@media (max-width: 768px) {
  .correlation-diagram {
    padding: 1rem;
  }

  .heatmap-grid {
    gap: 3px;
    padding: 0.75rem;
  }

  .heatmap-cell {
    font-size: 0.55rem;
  }
}

/* Network Diagram Styles */
.network-diagram {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  perspective: 1500px;
}

.network-svg {
  width: 100%;
  height: auto;
  max-width: 650px;
  transform-style: preserve-3d;
  transform: rotateX(5deg) rotateY(-3deg) scale(0.95);
  transition: transform 0.8s ease;
  filter: drop-shadow(0 15px 40px rgba(0, 0, 0, 0.6));
}

.network-diagram:hover .network-svg {
  transform: rotateX(0deg) rotateY(0deg) scale(1);
  filter: drop-shadow(0 20px 50px rgba(253, 137, 36, 0.3));
}

/* Connection Groups */
.connection-group {
  cursor: pointer;
}

.connection-line {
  transition: all 0.5s ease;
  animation: fadeInConnection 0.8s ease-out forwards;
}

.connection-group[data-from="users"][data-to="orders"] .connection-line,
.connection-group[data-from="users"][data-to="orders"] .connection-dot,
.connection-group[data-from="users"][data-to="orders"] .connection-label {
  animation-delay: 0.8s;
}

.connection-group[data-from="users"][data-to="addresses"] .connection-line,
.connection-group[data-from="users"][data-to="addresses"] .connection-dot,
.connection-group[data-from="users"][data-to="addresses"] .connection-label {
  animation-delay: 1.0s;
}

.connection-group[data-from="orders"][data-to="products"] .connection-line,
.connection-group[data-from="orders"][data-to="products"] .connection-dot,
.connection-group[data-from="orders"][data-to="products"] .connection-label {
  animation-delay: 1.2s;
}

.connection-group[data-from="orders"][data-to="payments"] .connection-line,
.connection-group[data-from="orders"][data-to="payments"] .connection-dot,
.connection-group[data-from="orders"][data-to="payments"] .connection-label {
  animation-delay: 1.4s;
}

@keyframes fadeInConnection {
  from {
    opacity: 0;
  }
  to {
    opacity: 0.7;
  }
}

.connection-dot {
  animation: fadeInConnection 0.8s ease-out forwards;
  filter: drop-shadow(0 0 6px rgba(253, 137, 36, 0.8));
}

.connection-label {
  animation: fadeInConnection 0.8s ease-out forwards;
}

/* Hover effects for connections */
.connection-group:hover .connection-line,
.connection-group.active .connection-line {
  opacity: 1 !important;
  stroke-width: 5;
  filter: drop-shadow(0 0 12px rgba(253, 137, 36, 1));
}

.connection-group:hover .connection-dot,
.connection-group.active .connection-dot {
  opacity: 1 !important;
  filter: drop-shadow(0 0 15px rgba(253, 137, 36, 1));
}

.connection-group:hover .connection-label,
.connection-group.active .connection-label {
  opacity: 1 !important;
}

/* Table nodes */
.table-node {
  cursor: pointer;
  transition: all 0.4s ease;
  opacity: 0;
  animation: fadeInTable 0.6s ease-out forwards;
}

.table-node[data-table="users"] {
  animation-delay: 0.1s;
}

.table-node[data-table="orders"] {
  animation-delay: 0.3s;
}

.table-node[data-table="products"] {
  animation-delay: 0.5s;
}

.table-node[data-table="addresses"] {
  animation-delay: 0.2s;
}

.table-node[data-table="payments"] {
  animation-delay: 0.4s;
}

@keyframes fadeInTable {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.table-rect {
  transition: all 0.4s ease;
}

.table-node:hover .table-rect {
  fill: url(#tableGradientActive);
  stroke-width: 4;
  filter: drop-shadow(0 0 20px rgba(253, 137, 36, 0.6));
}

.table-node text {
  pointer-events: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Monaco", monospace;
}

.table-node use {
  pointer-events: none;
}

/* Legend */
.network-legend {
  opacity: 0;
  animation: fadeIn 0.8s ease-out forwards;
  animation-delay: 1.8s;
}

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

.network-legend rect {
  transition: all 0.3s ease;
}

.network-legend:hover rect {
  fill: rgba(0, 0, 0, 0.8);
  stroke-width: 2;
}

.network-legend text {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Responsive adjustments for network diagram */
@media (max-width: 1024px) {
  .network-svg {
    transform: rotateX(3deg) rotateY(-2deg) scale(0.95);
  }

  .network-diagram:hover .network-svg {
    transform: rotateX(0deg) rotateY(0deg) scale(1);
  }
}

@media (max-width: 768px) {
  .network-diagram {
    padding: 1rem;
  }

  .network-svg {
    transform: rotateX(2deg) rotateY(-1deg) scale(0.9);
    max-width: 100%;
  }

  .table-node text {
    font-size: 9px;
  }
}

/* Bias Detection Diagram Styles */
.bias-diagram {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  perspective: 1200px;
}

.bias-comparison {
  display: flex;
  align-items: center;
  gap: 2rem;
  transform-style: preserve-3d;
  transform: rotateY(-3deg);
  transition: transform 0.6s ease;
}

.bias-diagram:hover .bias-comparison {
  transform: rotateY(0deg);
}

.bias-chart-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid rgba(253, 137, 36, 0.2);
  opacity: 0;
  animation: fadeInBias 0.8s ease-out forwards;
}

.bias-chart-container:first-child {
  animation-delay: 0.2s;
}

.bias-chart-container:last-child {
  animation-delay: 0.8s;
}

@keyframes fadeInBias {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.bias-chart-title {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.5px;
}

.bias-chart {
  width: 200px;
  height: 180px;
}

.bias-bar, .fair-bar {
  opacity: 0;
  animation: growBar 0.8s ease-out forwards;
  transition: all 0.3s ease;
  cursor: pointer;
}

.bias-bar[data-index="0"] {
  animation-delay: 0.5s;
}

.bias-bar[data-index="1"] {
  animation-delay: 0.7s;
}

.bias-bar[data-index="2"] {
  animation-delay: 0.9s;
}

.fair-bar[data-index="0"] {
  animation-delay: 1.2s;
}

.fair-bar[data-index="1"] {
  animation-delay: 1.4s;
}

.fair-bar[data-index="2"] {
  animation-delay: 1.6s;
}

@keyframes growBar {
  from {
    opacity: 0;
    transform: scaleY(0);
    transform-origin: bottom;
  }
  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

.bias-bar:hover, .fair-bar:hover {
  filter: brightness(1.2);
  transform: scaleY(1.05);
  transform-origin: bottom;
}

.bias-warning, .bias-success {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  animation: fadeIn 0.5s ease-out forwards;
}

.bias-warning {
  background: rgba(255, 68, 68, 0.15);
  color: #ff4444;
  border: 1px solid rgba(255, 68, 68, 0.3);
  animation-delay: 1.1s;
}

.bias-success {
  background: rgba(0, 221, 136, 0.15);
  color: #00dd88;
  border: 1px solid rgba(0, 221, 136, 0.3);
  animation-delay: 1.8s;
}

.bias-arrow {
  opacity: 0;
  animation: fadeIn 0.8s ease-out forwards;
  animation-delay: 1.0s;
}

/* PII Detection Diagram Styles */
.pii-diagram {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  perspective: 1200px;
}

.pii-table-container {
  width: 100%;
  max-width: 550px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  border: 1px solid rgba(253, 137, 36, 0.3);
  padding: 1.5rem;
  transform-style: preserve-3d;
  transform: rotateX(5deg) scale(0.98);
  transition: transform 0.6s ease;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.pii-diagram:hover .pii-table-container {
  transform: rotateX(0deg) scale(1);
  box-shadow: 0 15px 50px rgba(253, 137, 36, 0.2);
}

.pii-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(253, 137, 36, 0.2);
}

.pii-scan-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fd8924;
  font-size: 0.85rem;
  font-weight: 600;
}

.scanning-icon {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.pii-data-table {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.pii-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.pii-header-row .pii-cell {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.5rem;
}

.pii-data-row {
  opacity: 0;
  animation: fadeInRow 0.5s ease-out forwards;
}

.pii-data-row[data-row="1"] {
  animation-delay: 0.3s;
}

.pii-data-row[data-row="2"] {
  animation-delay: 0.5s;
}

.pii-data-row[data-row="3"] {
  animation-delay: 0.7s;
}

@keyframes fadeInRow {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.pii-cell {
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  position: relative;
  transition: all 0.3s ease;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
}

.pii-sensitive {
  background: rgba(253, 137, 36, 0.1);
  border: 1px solid rgba(253, 137, 36, 0.3);
  cursor: pointer;
}

.pii-sensitive:hover {
  background: rgba(253, 137, 36, 0.2);
  border-color: rgba(253, 137, 36, 0.5);
}

.pii-safe {
  background: rgba(0, 221, 136, 0.05);
  border: 1px solid rgba(0, 221, 136, 0.2);
  color: rgba(255, 255, 255, 0.7);
}

.pii-original {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  opacity: 1;
  transition: opacity 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pii-synthetic {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  color: #00dd88;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pii-sensitive:hover .pii-original {
  opacity: 0;
}

.pii-sensitive:hover .pii-synthetic {
  opacity: 1;
}

.pii-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #00dd88;
  color: #000;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.pii-sensitive:hover .pii-badge {
  opacity: 1;
}

.pii-stats {
  display: flex;
  gap: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(253, 137, 36, 0.2);
  opacity: 0;
  animation: fadeIn 0.5s ease-out forwards;
  animation-delay: 1s;
}

.pii-stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.pii-stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fd8924;
}

.pii-stat-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .bias-comparison {
    flex-direction: column;
    gap: 1.5rem;
  }

  .bias-arrow svg {
    transform: rotate(90deg);
  }
}

@media (max-width: 768px) {
  .bias-diagram,
  .pii-diagram {
    padding: 1rem;
  }

  .pii-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .pii-header-row .pii-cell:nth-child(3),
  .pii-header-row .pii-cell:nth-child(4),
  .pii-data-row .pii-cell:nth-child(3),
  .pii-data-row .pii-cell:nth-child(4) {
    display: none;
  }
}
