/* ─── TOKENS (abgeleitet von style-neu.css) ─── */
:root {
  --bg:           #09090f;
  --surface:      #111119;
  --surface-2:    #1c1c28;
  --code-bg:      #0b0b12;
  --text:         #f1f5f9;
  --muted:        #8892a4;
  --border:       rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.14);
  --glass:        rgba(255,255,255,0.03);
  --glass-hover:  rgba(255,255,255,0.06);
  --shadow:       0 2px 16px rgba(0,0,0,0.4);
  --shadow-hover: 0 8px 40px rgba(0,0,0,0.65);
  --radius:       12px;
  --radius-sm:    6px;
  --radius-pill:  999px;

  /* Istio-Komponenten-Farbcode, konsistent in HTML + SVG-Diagrammen */
  --c-ingress:  #3b82f6;  /* Ingress Gateway / externer Eintritt */
  --c-routing:  #a855f7;  /* VirtualService / Routing-Logik */
  --c-policy:   #f59e0b;  /* DestinationRule / Policies */
  --c-data:     #22c55e;  /* Service / Data Plane */
  --c-security: #e05c7a;  /* Sidecar / mTLS / Security */
  --c-external: #22d3ee;  /* External Service / Egress Gateway */
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ── Navigation ── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(9,9,15,.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: .7rem 2rem;
  display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
}
nav .brand {
  font-weight: 800; font-size: 1.05rem; margin-right: .8rem;
  background: linear-gradient(135deg, #60a5fa 0%, #c084fc 45%, #22d3ee 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
nav a {
  color: var(--muted); text-decoration: none; font-size: .82rem;
  padding: .4rem .8rem; border-radius: var(--radius-pill);
  border: 1px solid transparent;
  transition: color .18s, background .18s, border-color .18s;
  white-space: nowrap;
}
nav a:hover { color: var(--text); background: var(--glass); border-color: var(--border); }
nav a.nav-back { margin-left: auto; }

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 4.5rem 2rem 3.5rem;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 30% 20%, rgba(59,130,246,.14) 0%, transparent 70%),
    radial-gradient(ellipse 50% 70% at 75% 10%, rgba(168,85,247,.12) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 50% 100%, rgba(34,211,238,.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero .tag {
  position: relative;
  display: inline-block;
  background: rgba(168,85,247,.13);
  border: 1px solid rgba(168,85,247,.4);
  border-radius: 20px;
  padding: .3rem 1rem;
  font-size: .78rem;
  color: #c084fc;
  margin-bottom: 1.3rem;
  text-transform: uppercase; letter-spacing: .08em;
}
.hero h1 {
  position: relative;
  font-size: clamp(1.9rem, 4.2vw, 3rem); line-height: 1.18; margin-bottom: 1rem;
  font-weight: 800; letter-spacing: -.02em;
  background: linear-gradient(135deg, #60a5fa 0%, #c084fc 45%, #22d3ee 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p { position: relative; color: var(--muted); max-width: 700px; margin: 0 auto; font-size: 1.02rem; }

/* ── Layout ── */
main { max-width: 1140px; margin: 0 auto; padding: 0 2rem 6rem; }
section { padding-top: 4rem; }
h2 {
  font-size: 1.55rem; margin-bottom: 1.4rem;
  display: flex; align-items: center; gap: .7rem;
}
h2 .num {
  background: linear-gradient(135deg, #60a5fa, #a855f7);
  border-radius: 7px; color: #fff;
  padding: .15rem .55rem; font-size: .82rem; font-weight: 700;
}
h3 { font-size: 1.1rem; margin: 1.8rem 0 .7rem; color: #60a5fa; }
h4 { font-size: .95rem; margin: 1rem 0 .5rem; color: var(--text); }
p { margin-bottom: .9rem; }
ul, ol { padding-left: 1.4rem; margin-bottom: .9rem; }
li { margin-bottom: .4rem; }
strong { color: #fff; }
code { font-family: 'SF Mono','Fira Code','Cascadia Code', Consolas, monospace; font-size: .88em; background: var(--glass); padding: .1rem .35rem; border-radius: 4px; }

/* ── Cards ── */
.card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-hover); }
.card h3, .card h4 { margin-top: 0; }
.card.ingress  { border-left: 3px solid var(--c-ingress); }
.card.routing  { border-left: 3px solid var(--c-routing); }
.card.policy   { border-left: 3px solid var(--c-policy); }
.card.data     { border-left: 3px solid var(--c-data); }
.card.security { border-left: 3px solid var(--c-security); }
.card.external { border-left: 3px solid var(--c-external); }

/* ── Grid ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
@media (max-width: 800px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ── Code blocks ── */
pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.4rem;
  overflow-x: auto;
  font-size: .8rem;
  line-height: 1.6;
  margin-bottom: 1.2rem;
  font-family: 'SF Mono','Fira Code','Cascadia Code', Consolas, monospace;
}
pre code { background: none; padding: 0; font-size: 1em; }
.kw  { color: #c084fc; }
.str { color: #86efac; }
.cm  { color: #565f89; font-style: italic; }
.val { color: #f0a742; }
.key { color: #60a5fa; }

/* ── Diagram container ── */
.diagram {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 1rem;
  margin-bottom: 1.2rem;
  overflow-x: auto;
}
.diagram-caption {
  text-align: center; font-size: .8rem; color: var(--muted);
  margin-top: -.6rem; margin-bottom: 1.2rem;
}

/* ── Legend ── */
.legend { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; margin-bottom: 1.4rem; font-size: .82rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: .45rem; }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* ── Badges ── */
.badge { display: inline-block; padding: .15rem .55rem; border-radius: var(--radius-sm); font-size: .72rem; font-weight: 600; }
.b-ingress  { background: rgba(59,130,246,.18);  color: #60a5fa; }
.b-routing  { background: rgba(168,85,247,.18);  color: #c084fc; }
.b-policy   { background: rgba(245,158,11,.18);  color: #fbbf24; }
.b-data     { background: rgba(34,197,94,.18);   color: #4ade80; }
.b-security { background: rgba(224,92,122,.2);   color: #f4879c; }
.b-external { background: rgba(34,211,238,.18);  color: #22d3ee; }

/* ── Table ── */
table { width: 100%; border-collapse: collapse; font-size: .86rem; margin-bottom: 1.2rem; }
th {
  background: rgba(96,165,250,.1);
  color: #60a5fa; text-align: left;
  padding: .7rem .9rem; border-bottom: 2px solid var(--border);
}
td { padding: .65rem .9rem; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:hover td { background: rgba(255,255,255,.025); }

/* ── Steps (numbered traffic flow) ── */
.steps { counter-reset: step; list-style: none; padding-left: 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: .3rem 0 .3rem 2.4rem;
  margin-bottom: .5rem;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: .15rem;
  width: 1.6rem; height: 1.6rem;
  background: linear-gradient(135deg, #60a5fa, #a855f7);
  color: #fff; font-weight: 700; font-size: .8rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

hr { border: none; border-top: 1px solid var(--border); margin: 3rem 0; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }
