/* ============================================
   NetDevOps Landing Page — Style
   ============================================ */

/* --- SVG theme-aware classes (Samsung Internet fix for var() in attrs) --- */
.svg-bg { fill: var(--bg-primary); }
.svg-stroke-sec { stroke: var(--text-secondary); }
.svg-fill-sec { fill: var(--text-secondary); }
.svg-fill-pri { fill: var(--text-primary); }

/* --- Inter variable font (self-hosted) --- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../assets/fonts/Inter-Variable.woff2') format('woff2');
}

/* --- Custom Properties --- */
:root {
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --header-height: 60px;
  --bg-primary: #f4f2ee;
  --bg-secondary: #eae7e1;
  --bg-tertiary: #e4e0da;
  --text-primary: #1a1a1a;
  --text-secondary: #6b6b6b;
  --text-muted: #a0a0a0;
  --glass-bg-layer-bottom: rgba(255, 255, 255, 0.45);
  --glass-bg-layer-top: rgba(255, 255, 255, 0.25);
  --glass-bg-card: rgba(255, 255, 255, 0.4);
  --glass-border: rgba(255, 255, 255, 0.45);
  --accent-gitops: #4a6fa5;
  --accent-sot: #7b5ea7;
  --status-active: #5daa68;
  --header-name: #777;
  --header-link: #999;
  --header-link-hover: #444;
  --header-scrolled-bg: rgba(244, 242, 238, 0.8);
  --header-avatar-from: #ddd;
  --header-avatar-to: #bbb;
  --toggle-hover-bg: rgba(0, 0, 0, 0.06);
  --hero-gradient: rgba(210, 205, 195, 0.5);
  --layer-label: rgba(0, 0, 0, 0.3);
  --layer-bg-from: rgba(255,255,255,0.3);
  --layer-bg-mid: rgba(255,255,255,0.1);
  --layer-bg-to: rgba(255,255,255,0.2);
  --layer-border-top: rgba(255, 255, 255, 0.7);
  --layer-border-left: rgba(255, 255, 255, 0.4);
  --layer-border-right: rgba(255, 255, 255, 0.15);
  --layer-border-bottom: rgba(255, 255, 255, 0.08);
  --layer-inset-top: rgba(255, 255, 255, 0.25);
  --layer-inset-bottom: rgba(0, 0, 0, 0.03);
  --pipeline-card-bg: rgba(255, 255, 255, 0.55);
  --pipeline-card-border: rgba(0, 0, 0, 0.04);
  --pipeline-step-bg: rgba(255, 255, 255, 0.5);
  --pipeline-step-border: rgba(255, 255, 255, 0.6);
  --pipeline-step-name: #333;
  --pipeline-step-icon-bg: rgba(0, 0, 0, 0.03);
  --scroll-indicator-color: #bbb;
  --blobs-a: rgba(74, 111, 165, 0.12);
  --blobs-b: rgba(123, 94, 167, 0.1);
  --blobs-c: rgba(180, 160, 120, 0.08);
}

/* --- Dark theme --- */
[data-theme="dark"] {
  --bg-primary: #0e1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #1c2230;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #484f58;
  --glass-bg-layer-bottom: rgba(255, 255, 255, 0.06);
  --glass-bg-layer-top: rgba(255, 255, 255, 0.03);
  --glass-bg-card: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.08);
  --accent-gitops: #79a5d6;
  --accent-sot: #a689c9;
  --status-active: #6fca7a;
  --cta-bg: #f0f0f0;
  --cta-text: #0e1117;
  --header-name: #8b949e;
  --header-link: #8b949e;
  --header-link-hover: #e6edf3;
  --header-scrolled-bg: rgba(14, 17, 23, 0.8);
  --header-avatar-from: #333;
  --header-avatar-to: #555;
  --header-avatar-text: #666;
  --toggle-hover-bg: rgba(255, 255, 255, 0.08);
  --hero-gradient: rgba(40, 45, 55, 0.5);
  --layer-label: rgba(255, 255, 255, 0.3);
  --layer-bg-from: rgba(255,255,255,0.06);
  --layer-bg-mid: rgba(255,255,255,0.02);
  --layer-bg-to: rgba(255,255,255,0.04);
  --layer-border-top: rgba(255, 255, 255, 0.12);
  --layer-border-left: rgba(255, 255, 255, 0.06);
  --layer-border-right: rgba(255, 255, 255, 0.03);
  --layer-border-bottom: rgba(255, 255, 255, 0.01);
  --layer-inset-top: rgba(255, 255, 255, 0.06);
  --layer-inset-bottom: rgba(0, 0, 0, 0.1);
  --pipeline-card-bg: rgba(255, 255, 255, 0.04);
  --pipeline-card-border: rgba(255, 255, 255, 0.06);
  --pipeline-step-bg: rgba(255, 255, 255, 0.04);
  --pipeline-step-border: rgba(255, 255, 255, 0.06);
  --pipeline-step-name: #c9d1d9;
  --pipeline-step-icon-bg: rgba(255, 255, 255, 0.04);
  --scroll-indicator-color: #484f58;
  --blobs-a: rgba(74, 111, 165, 0.08);
  --blobs-b: rgba(123, 94, 167, 0.06);
  --blobs-c: rgba(180, 160, 120, 0.04);
}

/* --- Theme transition (only active during toggle, not permanently) --- */
[data-transitioning] *:not(.theme-toggle *),
[data-transitioning] *::before,
[data-transitioning] *::after {
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}

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

html {
  scroll-behavior: smooth;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

/* --- Grain texture overlay --- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
}

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

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 80px;
  max-width: 100vw;
  overflow-x: hidden;
  background: transparent;
  transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

.header--scrolled {
  background: var(--header-scrolled-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header__left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--header-avatar-from), var(--header-avatar-to));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.header__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header__name {
  font-size: 13px;
  font-weight: 500;
  color: var(--header-name);
  letter-spacing: 0.3px;
}

.header__name::after {
  content: '_';
  margin-left: 2px;
  color: #5ba8a0;
  animation: cursor-blink 0.8s step-end infinite;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.header__right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header__icon-link {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--header-link);
  transition: color 0.2s, background 0.2s;
}

.header__icon-link:hover {
  color: var(--header-link-hover);
  background: var(--toggle-hover-bg);
}

/* --- Theme Toggle Button --- */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background 0.2s, color 0.2s;
}

.theme-toggle:hover {
  background: var(--toggle-hover-bg);
  color: var(--text-primary);
}

.theme-toggle svg {
  overflow: visible;
}

.theme-toggle .sun-core {
  transform-origin: 12px 12px;
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: scale(1);
}

.theme-toggle .moon-group {
  transform-origin: 12px 12px;
  transition: transform 0.8s cubic-bezier(0.45, 0, 0.55, 1);
  transform: rotate(0deg);
}

.theme-toggle .moon-mask-circle {
  transition: cx 0.6s cubic-bezier(0.45, 0, 0.55, 1),
              cy 0.6s cubic-bezier(0.45, 0, 0.55, 1);
  cx: 26;
  cy: -4;
}

.theme-toggle .ray {
  transform-origin: 12px 12px;
  transition: opacity 0.3s, x1 0.3s, y1 0.3s, x2 0.3s, y2 0.3s;
  transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="dark"] .theme-toggle .sun-core {
  transform: scale(0);
}

[data-theme="dark"] .theme-toggle .moon-mask-circle {
  cx: 14;
  cy: 8;
}

[data-theme="dark"] .theme-toggle .moon-group {
  transform: rotate(30deg);
}

[data-theme="dark"] .theme-toggle .ray {
  opacity: 0;
}


/* --- Hero anchors (invisible jump points, one per layer slide) --- */
.hero__anchor {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.hero__anchor--2 { top: 25%; }
.hero__anchor--3 { top: 50%; }
.hero__anchor--4 { top: 75%; }

/* --- Hero Wrapper (scroll lock for layer animations) --- */
.hero-wrapper {
  position: relative;
  height: 300vh; /* Extra scroll space for layer animation */
  z-index: 2;
  pointer-events: none; /* Let clicks pass through to arch section below */
}

/* --- Hero --- */
.hero {
  pointer-events: auto;
  position: sticky;
  top: 0;
  height: 100vh;
  padding-top: var(--header-height);
  display: flex;
  overflow: visible;
  background: var(--bg-primary);
}

.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -5%;
  width: 60%;
  height: 120%;
  background: radial-gradient(ellipse, var(--hero-gradient) 0%, transparent 65%);
  pointer-events: none;
}

.hero__left {
  flex: 1 1 50%;
  min-width: 0;
  position: relative;
  z-index: 5;
}

.hero__slide {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 56px 0 80px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}

.hero__slide--active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.hero__eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 24px;
}

.hero__title {
  font-size: 50px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -2px;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.hero__title-light {
  font-weight: 300;
  color: var(--text-muted);
}

.hero__content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  opacity: 0.8;
  margin-bottom: 32px;
  max-width: 440px;
}


/* --- Scroll Indicator --- */
.scroll-indicator {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--scroll-indicator-color);
  z-index: 10;
  transition: opacity 0.3s;
}

.scroll-indicator--hidden {
  opacity: 0;
  pointer-events: none;
}

.scroll-indicator__text {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.scroll-indicator__arrow {
  animation: bounce 2.5s ease infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* --- Hero Right: Isometric Layers --- */
.hero__right {
  flex: 1 1 50%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  perspective: 1000px;
}

/* Ambient gradient mesh behind layers — subtle warmth for glass refraction */
.hero__blobs {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 20% 30%, var(--blobs-a) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, var(--blobs-b) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, var(--blobs-c) 0%, transparent 60%);
}

.layer {
  position: absolute;
  width: min(380px, 80%);
  height: min(380px, 80%);
  aspect-ratio: 1;
  border-radius: 28px;
  /* Realistic glass: visible tint + heavy blur to distort blobs behind */
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.25) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.15) 100%
  );
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  /* Realistic edge highlights — light hits top-left */
  border-top: 1.5px solid var(--layer-border-top);
  border-left: 1px solid var(--layer-border-left);
  border-right: 1px solid var(--layer-border-right);
  border-bottom: 1px solid var(--layer-border-bottom);
  /* Inner reflection + depth shadow */
  box-shadow:
    inset 0 2px 4px var(--layer-inset-top),
    inset 0 -1px 2px var(--layer-inset-bottom),
    0 8px 32px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 8px 8px 28px; /* Top/sides padding + bottom for label */
  transform: rotateX(50deg) rotateZ(-45deg);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
}


.layer__label {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  font-weight: 700;
  color: var(--layer-label);
}

/* --- WDM Fiber lines (inside layer topology SVG) --- */
.fiber-base {
  fill: none;
  stroke-linecap: round;
  opacity: 0.8;
}

.fiber-glow {
  fill: none;
  stroke-linecap: round;
  opacity: 0;
  stroke-dasharray: 60 1740;
  will-change: stroke-dashoffset, opacity;
}

/* Each fiber: independent speed + random start delay */
.fiber-glow--1 { animation: packet-1 4.2s linear infinite 0.3s; }
.fiber-glow--2 { animation: packet-2 7.1s linear infinite 2.8s; }
.fiber-glow--3 { animation: packet-3 5.5s linear infinite 1.1s; }
.fiber-glow--4 { animation: packet-4 8.3s linear infinite 4.6s; }
.fiber-glow--5 { animation: packet-5 6.0s linear infinite 0.8s; }

@keyframes packet-1 {
  0%   { stroke-dashoffset: 1800; opacity: 0; }
  5%   { opacity: 0.9; }
  88%  { opacity: 0.9; }
  100% { stroke-dashoffset: -60; opacity: 0; }
}
@keyframes packet-2 {
  0%   { stroke-dashoffset: 1800; opacity: 0; }
  4%   { opacity: 0.85; }
  92%  { opacity: 0.85; }
  100% { stroke-dashoffset: -60; opacity: 0; }
}
@keyframes packet-3 {
  0%   { stroke-dashoffset: 1800; opacity: 0; }
  6%   { opacity: 0.95; }
  86%  { opacity: 0.95; }
  100% { stroke-dashoffset: -60; opacity: 0; }
}
@keyframes packet-4 {
  0%   { stroke-dashoffset: 1800; opacity: 0; }
  3%   { opacity: 0.8; }
  94%  { opacity: 0.8; }
  100% { stroke-dashoffset: -60; opacity: 0; }
}
@keyframes packet-5 {
  0%   { stroke-dashoffset: 1800; opacity: 0; }
  5%   { opacity: 0.9; }
  90%  { opacity: 0.9; }
  100% { stroke-dashoffset: -60; opacity: 0; }
}

/* --- L2: VXLAN tunnel glow animation (random per tunnel) --- */
.tunnel-glow {
  fill: none;
  stroke-linecap: round;
  opacity: 0.8;
  stroke-dasharray: 25 200;
  will-change: stroke-dashoffset;
}

/* tunnel 1: aller (gauche → droite) */
.tunnel-glow--1 { animation: tunnel-fwd 3.5s linear infinite 0.6s; }
/* tunnel 2: retour (droite → gauche) */
.tunnel-glow--2 { animation: tunnel-rev 2.8s linear infinite 1.9s; }
/* tunnel 3: aller (gauche → droite) */
.tunnel-glow--3 { animation: tunnel-fwd 4.2s linear infinite 0.2s; }

@keyframes tunnel-fwd {
  0%   { stroke-dashoffset: 500; }
  100% { stroke-dashoffset: -25; }
}
@keyframes tunnel-rev {
  0%   { stroke-dashoffset: -25; }
  100% { stroke-dashoffset: 500; }
}

/* --- L2: BUM packet flow animation (sequential propagation) --- */
.bum-glow {
  fill: none;
  stroke-linecap: round;
  opacity: 0.85;
  stroke-dasharray: 60 500;
  stroke-dashoffset: 250;
  will-change: stroke-dashoffset;
}

.bum-glow--1 { animation: bum-hop1 20s linear infinite; }
.bum-glow--2 { animation: bum-hop2 20s linear infinite; }
.bum-glow--3 { animation: bum-hop3 20s linear infinite; }
.bum-glow--4 { animation: bum-hop4 20s linear infinite; }
.bum-glow--5 { animation: bum-hop5 20s linear infinite; }

/* Step1: 0-10%, Step2,3,4: 8-18%, Step5: 16-26% (6% overlap) */
@keyframes bum-hop1 {
  0%   { stroke-dashoffset: 250; }
  10%  { stroke-dashoffset: -120; }
  100% { stroke-dashoffset: -120; }
}
@keyframes bum-hop2 {
  0%   { stroke-dashoffset: 250; }
  8%   { stroke-dashoffset: 250; }
  18%  { stroke-dashoffset: -120; }
  100% { stroke-dashoffset: -120; }
}
@keyframes bum-hop3 {
  0%   { stroke-dashoffset: 250; }
  8%   { stroke-dashoffset: 250; }
  18%  { stroke-dashoffset: -120; }
  100% { stroke-dashoffset: -120; }
}
@keyframes bum-hop4 {
  0%   { stroke-dashoffset: 250; }
  8%   { stroke-dashoffset: 250; }
  18%  { stroke-dashoffset: -120; }
  100% { stroke-dashoffset: -120; }
}
@keyframes bum-hop5 {
  0%   { stroke-dashoffset: 250; }
  16%  { stroke-dashoffset: 250; }
  26%  { stroke-dashoffset: -120; }
  100% { stroke-dashoffset: -120; }
}

/* --- L2: Unicast replies after BUM (green) --- */
.reply-glow {
  fill: none;
  stroke-linecap: round;
  opacity: 0.85;
  stroke-dasharray: 60 500;
  stroke-dashoffset: 250;
  will-change: stroke-dashoffset;
}

/* Reply 1: HOST-A → VTEP-1 → HOST-B (2 hops, starts at 50%) */
.reply-glow--1a { animation: reply-1a 20s linear infinite; }
.reply-glow--1b { animation: reply-1b 20s linear infinite; }
/* Reply 2: HOST-C → VTEP-2 → VTEP-1 → HOST-B (3 hops, starts at 50%) */
.reply-glow--2a { animation: reply-2a 20s linear infinite; }
.reply-glow--2b { animation: reply-2b 20s linear infinite; }
.reply-glow--2c { animation: reply-2c 20s linear infinite; }
/* Reply 3: VTEP-3 → VTEP-1 → HOST-B (2 hops, starts at 50%) */
.reply-glow--3a { animation: reply-3a 20s linear infinite; }
.reply-glow--3b { animation: reply-3b 20s linear infinite; }

/* Reply 1: HOST-A (local, 2 hops) — starts 32% */
@keyframes reply-1a {
  0%   { stroke-dashoffset: 250; }
  32%  { stroke-dashoffset: 250; }
  40%  { stroke-dashoffset: -120; }
  100% { stroke-dashoffset: -120; }
}
@keyframes reply-1b {
  0%   { stroke-dashoffset: 250; }
  38%  { stroke-dashoffset: 250; }
  46%  { stroke-dashoffset: -120; }
  100% { stroke-dashoffset: -120; }
}

/* Reply 2: HOST-C (3 hops via tunnel) — starts 32% */
@keyframes reply-2a {
  0%   { stroke-dashoffset: 250; }
  32%  { stroke-dashoffset: 250; }
  40%  { stroke-dashoffset: -120; }
  100% { stroke-dashoffset: -120; }
}
@keyframes reply-2b {
  0%   { stroke-dashoffset: 250; }
  38%  { stroke-dashoffset: 250; }
  46%  { stroke-dashoffset: -120; }
  100% { stroke-dashoffset: -120; }
}
@keyframes reply-2c {
  0%   { stroke-dashoffset: 250; }
  44%  { stroke-dashoffset: 250; }
  52%  { stroke-dashoffset: -120; }
  100% { stroke-dashoffset: -120; }
}

/* Reply 3: VTEP-3 (2 hops via tunnel) — starts 32% */
@keyframes reply-3a {
  0%   { stroke-dashoffset: 250; }
  32%  { stroke-dashoffset: 250; }
  40%  { stroke-dashoffset: -120; }
  100% { stroke-dashoffset: -120; }
}
@keyframes reply-3b {
  0%   { stroke-dashoffset: 250; }
  38%  { stroke-dashoffset: 250; }
  46%  { stroke-dashoffset: -120; }
  100% { stroke-dashoffset: -120; }
}

/* --- L2: Unicast aller-retour Host-A ↔ Host-C (blue) --- */
/* Cycle total = 14s. Chaque hop dure ~2s (≈14% du cycle). */
/* Aller: hop1 0-14%, hop2 14-28%, hop3 28-42% */
/* Retour: hop4 50-64%, hop5 64-78%, hop6 78-92% */
.uni-link {
  fill: none;
  stroke-linecap: round;
  opacity: 0.85;
  stroke-dasharray: 60 500;
  stroke-dashoffset: 250;
  will-change: stroke-dashoffset;
}

.uni-link--1 { animation: uni-link1 25s linear infinite; }
.uni-link--2 { animation: uni-link2 25s linear infinite; }
.uni-link--3 { animation: uni-link3 25s linear infinite; }

/* Aller: link1 0-10%, link2 4-14%, link3 8-18% (6% overlap) */
/* Pause: 6% */
/* Retour: link3 24-34%, link2 28-38%, link1 32-42% (6% overlap) */
@keyframes uni-link1 {
  0%    { stroke-dashoffset: 250; }
  10%   { stroke-dashoffset: -120; }
  31.9% { stroke-dashoffset: -120; }
  42%   { stroke-dashoffset: 250; }
  100%  { stroke-dashoffset: 250; }
}
@keyframes uni-link2 {
  0%    { stroke-dashoffset: 250; }
  4%    { stroke-dashoffset: 250; }
  14%   { stroke-dashoffset: -120; }
  27.9% { stroke-dashoffset: -120; }
  38%   { stroke-dashoffset: 250; }
  100%  { stroke-dashoffset: 250; }
}
@keyframes uni-link3 {
  0%    { stroke-dashoffset: 250; }
  8%    { stroke-dashoffset: 250; }
  18%   { stroke-dashoffset: -120; }
  24%   { stroke-dashoffset: -120; }
  34%   { stroke-dashoffset: 250; }
  100%  { stroke-dashoffset: 250; }
}

/* --- L4: Push flow (orange ↓) GIT → ANSIBLE → NETBOX → SWITCHES --- */
.push-glow {
  fill: none;
  stroke-linecap: round;
  opacity: 0.85;
  stroke-dasharray: 60 500;
  stroke-dashoffset: 250;
  will-change: stroke-dashoffset;
}

/* GIT+NETBOX→ANSIBLE (simultanés), ANSIBLE→QUALIF, QUALIF→PROD */
.push-glow--1 { animation: push-hop1 12s linear infinite; }
.push-glow--2 { animation: push-hop1 12s linear infinite; }
.push-glow--3 { animation: push-hop2 12s linear infinite; }
.push-glow--4 { animation: push-hop3 12s linear infinite; }

@keyframes push-hop1 {
  0%   { stroke-dashoffset: 250; }
  12%  { stroke-dashoffset: -120; }
  100% { stroke-dashoffset: -120; }
}
@keyframes push-hop2 {
  0%   { stroke-dashoffset: 250; }
  10%  { stroke-dashoffset: 250; }
  22%  { stroke-dashoffset: -120; }
  100% { stroke-dashoffset: -120; }
}
@keyframes push-hop3 {
  0%   { stroke-dashoffset: 250; }
  20%  { stroke-dashoffset: 250; }
  32%  { stroke-dashoffset: -120; }
  100% { stroke-dashoffset: -120; }
}

/* --- L4: Stream flow (blue ↑) SWITCHES → gNMI → TELEGRAF → GRAFANA --- */
.stream-glow {
  fill: none;
  stroke-linecap: round;
  opacity: 0.85;
  stroke-dasharray: 60 500;
  stroke-dashoffset: 250;
  will-change: stroke-dashoffset;
}

/* PROD→gNMI, gNMI→TELEGRAF, TELEGRAF→PROM, PROM→GRAFANA */
.stream-glow--1 { animation: stream-hop1 10s linear infinite; }
.stream-glow--2 { animation: stream-hop2 10s linear infinite; }
.stream-glow--3 { animation: stream-hop3 10s linear infinite; }
.stream-glow--4 { animation: stream-hop4 10s linear infinite; }

@keyframes stream-hop1 {
  0%   { stroke-dashoffset: 250; }
  14%  { stroke-dashoffset: -120; }
  100% { stroke-dashoffset: -120; }
}
@keyframes stream-hop2 {
  0%   { stroke-dashoffset: 250; }
  12%  { stroke-dashoffset: 250; }
  26%  { stroke-dashoffset: -120; }
  100% { stroke-dashoffset: -120; }
}
@keyframes stream-hop3 {
  0%   { stroke-dashoffset: 250; }
  24%  { stroke-dashoffset: 250; }
  38%  { stroke-dashoffset: -120; }
  100% { stroke-dashoffset: -120; }
}
@keyframes stream-hop4 {
  0%   { stroke-dashoffset: 250; }
  36%  { stroke-dashoffset: 250; }
  50%  { stroke-dashoffset: -120; }
  100% { stroke-dashoffset: -120; }
}

/* --- L3: Route exchange animation (green, LEAF→RR→LEAFs) --- */
.route-glow {
  fill: none;
  stroke-linecap: round;
  opacity: 0.85;
  stroke-dasharray: 60 500;
  stroke-dashoffset: 250;
  will-change: stroke-dashoffset;
}

/* Step 1: LEAF-1 → RR (0-25%), Step 2+3: RR → LEAF-2/LEAF-3 (20-45%) */
.route-glow--1 { animation: route-hop1 8s linear infinite; }
.route-glow--2 { animation: route-hop2 8s linear infinite; }
.route-glow--3 { animation: route-hop3 8s linear infinite; }

@keyframes route-hop1 {
  0%   { stroke-dashoffset: 250; }
  25%  { stroke-dashoffset: -120; }
  100% { stroke-dashoffset: -120; }
}
@keyframes route-hop2 {
  0%   { stroke-dashoffset: 250; }
  20%  { stroke-dashoffset: 250; }
  45%  { stroke-dashoffset: -120; }
  100% { stroke-dashoffset: -120; }
}
@keyframes route-hop3 {
  0%   { stroke-dashoffset: 250; }
  20%  { stroke-dashoffset: 250; }
  45%  { stroke-dashoffset: -120; }
  100% { stroke-dashoffset: -120; }
}



.layer__topology {
  width: 95%;
  height: auto;
  margin-top: 0;
  overflow: visible;
}

/* Stacking — final resting positions (bottom to top) */
.layer--1 {
  background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.2) 100%);
  transform: rotateX(50deg) rotateZ(-45deg) translateZ(0px);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.3),
    inset 0 -1px 2px rgba(0, 0, 0, 0.03),
    0 20px 60px rgba(0, 0, 0, 0.08);
  z-index: 1;
}

.layer--2 {
  background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.18) 100%);
  transform: rotateX(50deg) rotateZ(-45deg) translateZ(60px);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.25),
    inset 0 -1px 2px rgba(0, 0, 0, 0.03),
    0 16px 48px rgba(0, 0, 0, 0.06);
  z-index: 12;
}

.layer--3 {
  background: linear-gradient(135deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.15) 100%);
  transform: rotateX(50deg) rotateZ(-45deg) translateZ(120px);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.2),
    inset 0 -1px 2px rgba(0, 0, 0, 0.03),
    0 12px 40px rgba(0, 0, 0, 0.05);
  z-index: 13;
}

.layer--4 {
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.12) 100%);
  transform: rotateX(50deg) rotateZ(-45deg) translateZ(180px);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.15),
    inset 0 -1px 2px rgba(0, 0, 0, 0.03),
    0 8px 32px rgba(0, 0, 0, 0.04);
  z-index: 14;
}

/* Initial state: layers 2-4 start above and invisible (drop-in effect) */
.layer--2,
.layer--3,
.layer--4 {
  opacity: 0;
}

.layer--2:not(.layer--revealed) {
  transform: rotateX(50deg) rotateZ(-45deg) translateZ(160px) translateY(-80px);
}

.layer--3:not(.layer--revealed) {
  transform: rotateX(50deg) rotateZ(-45deg) translateZ(220px) translateY(-80px);
}

.layer--4:not(.layer--revealed) {
  transform: rotateX(50deg) rotateZ(-45deg) translateZ(280px) translateY(-80px);
}

/* Animated state — layer drops into its final resting position */
.layer--revealed {
  opacity: 1 !important;
}

/* --- Architecture Wrapper (sticky horizontal carousel) --- */
/* ============================================
   Sources of Truth section
   ============================================ */
.sot-section {
  position: relative;
  min-height: 100vh;
  padding: 120px 80px 80px;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.sot-section__header {
  max-width: 720px;
  text-align: center;
  margin-bottom: 72px;
}

.sot-section__eyebrow {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 4px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.sot-section__title {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -1.5px;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 24px;
}

.sot-section__title-light {
  font-weight: 300;
  color: var(--text-secondary);
}

.sot-section__desc {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto;
}

.sot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  max-width: 1200px;
  width: 100%;
}

.sot-card {
  position: relative;
  background: var(--pipeline-card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--pipeline-card-border);
  border-radius: 20px;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s;
}

.sot-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 20px 56px rgba(0, 0, 0, 0.08);
}

.sot-card__logo {
  height: 56px;
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.sot-card__logo img {
  max-height: 100%;
  max-width: 180px;
  object-fit: contain;
}

.sot-card__year {
  position: absolute;
  top: 28px;
  right: 32px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-muted);
  opacity: 0.6;
}

.sot-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.sot-card__title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.sot-card__badge {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(91, 168, 160, 0.12);
  color: #5ba8a0;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 100px;
  border: 1px solid rgba(91, 168, 160, 0.25);
}

.sot-card__origin {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  opacity: 0.85;
}

.sot-card__origin strong {
  color: var(--text-primary);
  font-weight: 600;
}

.sot-card__desc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* ============================================
   Responsive
   ============================================ */

/* --- Tablet (768–1024px) --- */
@media (max-width: 1024px) {
  .header {
    padding: 0 40px;
  }

  .hero-wrapper {
    height: 250vh;
  }

  .hero {
    flex-direction: column;
  }

  .hero__left {
    padding: 0 40px;
    justify-content: center;
  }

  .hero__title {
    font-size: 42px;
  }

  .hero__right {
    justify-content: center;
    align-items: center;
  }

  .layer {
    width: min(340px, 80%, 40vh);
    height: min(340px, 80%, 40vh);
  }

  .layer--2.layer--revealed { transform: rotateX(50deg) rotateZ(-45deg) translateZ(45px); }
  .layer--3.layer--revealed { transform: rotateX(50deg) rotateZ(-45deg) translateZ(90px); }
  .layer--4.layer--revealed { transform: rotateX(50deg) rotateZ(-45deg) translateZ(135px); }

  /* SoT section tablet */
  .sot-section {
    padding: 80px 40px 60px;
  }

  .sot-section__title {
    font-size: 34px;
  }

  .sot-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: 640px;
  }
}

/* --- Mobile (<768px) --- */
@media (max-width: 767px) {
  :root {
    --header-height: 70px;
  }

  .header {
    padding: 0 24px;
  }

  .header__name {
    font-size: 12px;
  }

  .header__right {
    gap: 4px;
  }

  .header__icon-link {
    width: 30px;
    height: 30px;
  }

  .header__icon-link svg {
    width: 15px;
    height: 15px;
  }

  .hero-wrapper {
    height: 200vh;
  }

  .hero {
    flex-direction: column;
    height: 100svh; /* small viewport height — accounts for mobile address bar */
  }

  .hero__left {
    flex: 0 0 50%;
    height: 50%;
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }

  .hero__slide {
    padding: clamp(8px, 2vh, 20px) 24px;
    justify-content: flex-start;
    gap: clamp(4px, 0.8vh, 10px);
  }

  .hero__eyebrow {
    font-size: clamp(9px, 1.3vh, 12px);
    letter-spacing: 3px;
    margin-bottom: clamp(4px, 0.8vh, 10px);
  }

  .hero__title {
    font-size: clamp(18px, 3.2vh, 32px);
    letter-spacing: -0.5px;
    line-height: 1.15;
    margin-bottom: clamp(6px, 1.2vh, 14px);
  }

  .hero__content {
    font-size: clamp(10px, 1.4vh, 14px);
    line-height: 1.45;
  }

  .hero__right {
    flex: 0 0 50%;
    height: 50%;
    min-height: 0;
    justify-content: center;
    align-items: center;
    padding-top: clamp(20px, 4vh, 40px);
    overflow-x: clip;
    overflow-y: visible;
  }

  .layer {
    width: min(65vw, 42vh);
    height: min(65vw, 42vh);
    border-radius: 20px;
    padding: 6px 4px 18px;
  }

  .layer__topology {
    width: 98%;
  }

  .layer__label {
    bottom: 4px;
    font-size: 7px;
    letter-spacing: 2px;
  }

  .layer--2.layer--revealed { transform: rotateX(50deg) rotateZ(-45deg) translateZ(28px); }
  .layer--3.layer--revealed { transform: rotateX(50deg) rotateZ(-45deg) translateZ(56px); }
  .layer--4.layer--revealed { transform: rotateX(50deg) rotateZ(-45deg) translateZ(84px); }

  .scroll-indicator {
    bottom: 16px;
  }

  /* SoT section mobile */
  .sot-section {
    padding: 200px 24px 40px;
  }

  .sot-section__title {
    font-size: 28px;
  }

  .sot-section__desc {
    font-size: 14px;
  }

  .sot-card {
    padding: 28px 24px;
  }

  .sot-card__title {
    font-size: 20px;
  }

  .sot-card__desc {
    font-size: 13px;
  }
}

/* --- Accessibility --- */
:focus-visible {
  outline: 2px solid var(--accent-gitops);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --- Selection --- */
::selection {
  background: rgba(107, 140, 186, 0.2);
}

/* ============================================
   Footer
   ============================================ */
.footer {
  padding: 32px 80px;
  text-align: center;
  border-top: 1px solid var(--layer-border-bottom);
  background: var(--bg-primary);
}

.footer__copy {
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0.7;
  letter-spacing: 0.3px;
}

@media (max-width: 767px) {
  .footer {
    padding: 24px;
  }
}

/* ============================================
   Reduced motion (accessibility)
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
