/* ═══════════════════════════════════════════════════════════════
   Portfolio Konrad Pienkowski — Dark-Tech-Design
   Statische Seite, Fonts lokal, keine externen Abhängigkeiten
   ═══════════════════════════════════════════════════════════════ */

/* ---------- Fonts (lokal, DSGVO-konform) ---------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/inter-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fonts/inter-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../assets/fonts/inter-800.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/jetbrains-mono-400.woff2') format('woff2');
}

/* ---------- Design-Tokens ---------- */
:root {
  --bg-0: #070D18;
  --bg-1: #0B1220;
  --bg-2: #101B2E;
  --bg-input: #0D1626;
  --line: rgba(148, 180, 226, 0.13);
  --text-0: #F1F5FB;
  --text-1: #AEBDD3;
  --text-2: #7C8CA6;
  --cyan: #38BDF8;
  --cyan-soft: #7DD3FC;
  --violet: #818CF8;
  --grad-main: linear-gradient(98deg, #38BDF8 0%, #818CF8 100%);
  --grad-btn: linear-gradient(135deg, #0EA5E9, #6366F1);

  --c-m365: #38BDF8;
  --c-ki: #A78BFA;
  --c-sec: #FBBF24;
  --c-infra: #34D399;

  --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;

  --container: 1140px;
  --nav-h: 72px;
  --radius: 16px;
  --shadow-glow: 0 8px 30px rgba(14, 165, 233, 0.35);
}

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

html {
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}
/* Nur ohne JS-Animationen: globales scroll-behavior:smooth macht ScrollTriggers
   interne Mess-Scrolls asynchron und verfälscht beim refresh() alle Trigger-
   Positionen (Hero/Nav "hängen"). Mit js-anim übernimmt main.js das Smooth-Scrollen. */
@media (prefers-reduced-motion: no-preference) {
  html:not(.js-anim) { scroll-behavior: smooth; }
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-1);
  background-color: var(--bg-1);
  background-image:
    radial-gradient(ellipse 80% 50% at 70% -10%, rgba(30, 58, 110, 0.35), transparent),
    radial-gradient(ellipse 60% 40% at 10% 110%, rgba(49, 46, 129, 0.25), transparent);
  overflow-x: hidden;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: var(--cyan-soft); }
strong { color: var(--text-0); font-weight: 600; }
ul, ol { list-style: none; }
button { font-family: inherit; }

h1, h2, h3 { color: var(--text-0); line-height: 1.15; }
h1 {
  font-size: clamp(2.7rem, 6.5vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -1.5px;
}
h2 {
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 1.1rem;
}
h3 { font-weight: 600; }

.mono { font-family: var(--font-mono); }
.grad {
  background: var(--grad-main);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

::selection { background: var(--cyan); color: #06121F; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: #1E2F4A; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #2A4368; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 300;
  background: var(--bg-2);
  color: var(--text-0);
  padding: 10px 18px;
  border-radius: 10px;
  text-decoration: none;
  transition: top 0.25s ease;
}
.skip-link:focus { top: 12px; }

/* Reveal-Initialzustände nur, wenn JS + Animationen aktiv sind */
html.js-anim [data-reveal],
html.js-anim [data-hero-stagger] {
  opacity: 0;
  transform: translateY(28px);
}

/* ---------- Glas-Karten ----------
   blur(8px) statt 14px: hinter den Karten liegt nur der flache dunkle
   Seitenhintergrund — optisch kein Unterschied, aber die Blur-Kosten
   (38 Karten, beim Scrollen jedes Mal neu gesampelt) sinken deutlich. */
.glass {
  background: linear-gradient(160deg, rgba(22, 36, 61, 0.6), rgba(13, 22, 38, 0.55));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 12px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow 0.3s ease, background-color 0.3s ease, filter 0.3s ease;
  will-change: transform;
}
.btn-primary {
  background: var(--grad-btn);
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover {
  filter: brightness(1.12);
  box-shadow: 0 10px 40px rgba(14, 165, 233, 0.55);
}
.btn-ghost {
  border: 1px solid rgba(125, 211, 252, 0.35);
  color: #BFE3FA;
  background: rgba(56, 189, 248, 0.06);
}
.btn-ghost:hover { background: rgba(56, 189, 248, 0.14); }
.btn:disabled { opacity: 0.55; cursor: wait; filter: none; }

/* ---------- Globale Deko-Elemente ---------- */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--grad-main);
  transform: scaleX(0);
  transform-origin: 0 50%;
  /* Below nav (400) so it renders under the nav bar */
  z-index: 380;
  pointer-events: none;
}
#cursor-glow {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.07), transparent 60%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 3;
}
@media (pointer: fine) {
  html.js-anim #cursor-glow { display: block; }
}

/* ---------- Navigation ---------- */
#site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 400;
  border-bottom: 1px solid transparent;
  transition: background-color 0.35s ease, border-color 0.35s ease, backdrop-filter 0.35s ease;
}
#site-nav.scrolled {
  background: rgba(9, 15, 27, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.nav-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-logo {
  font-size: 0.95rem;
  color: var(--text-0);
  text-decoration: none;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.logo-accent { color: var(--cyan-soft); }
.logo-caret {
  color: var(--cyan);
  animation: caret-blink 1.1s steps(2) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }

#nav-menu {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-link {
  position: relative;
  font-size: 0.92rem;
  color: var(--text-1);
  text-decoration: none;
  padding: 6px 2px;
  transition: color 0.25s ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--grad-main);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s ease;
}
.nav-link:hover, .nav-link.active { color: var(--cyan-soft); }
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }

.nav-cta {
  background: var(--grad-btn);
  color: #fff !important;
  padding: 9px 18px !important;
  border-radius: 10px;
  font-weight: 600;
  box-shadow: 0 4px 18px rgba(14, 165, 233, 0.35);
  transition: filter 0.25s ease;
}
.nav-cta::after { display: none; }
.nav-cta:hover { filter: brightness(1.12); }

#nav-toggle {
  display: none;
  position: relative;
  z-index: 2;
  width: 42px;
  height: 42px;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
#nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-0);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
#nav-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
#nav-toggle.open span:nth-child(2) { opacity: 0; }
#nav-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 48px) 0 90px;
  overflow: hidden;
}
#particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
/* Kein filter:blur() — die radialen Verläufe laufen ohnehin weich aus, der
   80px-Blur war fast unsichtbar, kostete aber (v. a. in Firefox) massiv GPU,
   weil die Orbs per Parallax bei jedem Scroll-Frame bewegt werden.
   will-change nur ≥860px: nur dort läuft die Parallax-Animation. */
.orb {
  position: absolute;
  border-radius: 50%;
}
@media (min-width: 860px) {
  .orb { will-change: transform; }
}
.orb-1 {
  width: 56vmax; height: 56vmax;
  top: -18%; left: -16%;
  background: radial-gradient(circle at 35% 35%, rgba(14, 116, 198, 0.4), transparent 70%);
}
.orb-2 {
  width: 48vmax; height: 48vmax;
  top: 26%; right: -20%;
  background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.32), transparent 70%);
}
.orb-3 {
  width: 30vmax; height: 30vmax;
  bottom: -14%; left: 28%;
  background: radial-gradient(circle at 50% 50%, rgba(34, 211, 238, 0.22), transparent 70%);
}
.grid-overlay {
  position: absolute;
  inset: -15%;
  background-image:
    linear-gradient(rgba(125, 211, 252, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 211, 252, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 40%, #000 25%, transparent 75%);
  mask-image: radial-gradient(ellipse 75% 65% at 50% 40%, #000 25%, transparent 75%);
}
@media (min-width: 860px) {
  .grid-overlay { will-change: transform; }
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  align-items: center;
  gap: clamp(32px, 6vw, 72px);
  width: 100%;
}
.hero-kicker {
  color: var(--cyan-soft);
  font-size: 0.9rem;
  letter-spacing: 1.5px;
  margin-bottom: 18px;
}
.hero-typer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 18px;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  color: var(--text-0);
  min-height: 1.6em;
}
.typer-prompt { color: var(--cyan); }
.typer-caret {
  display: inline-block;
  width: 10px;
  height: 1.25em;
  background: var(--cyan);
  animation: caret-blink 0.95s steps(2) infinite;
}
.hero-sub {
  max-width: 540px;
  font-size: 1.07rem;
  margin-bottom: 30px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 34px; }
.hero-badges {
  color: var(--text-2);
  font-size: 0.8rem;
  letter-spacing: 0.6px;
}

.hero-photo {
  position: relative;
  justify-self: center;
}
.photo-ring {
  position: relative;
  width: clamp(250px, 28vw, 350px);
  aspect-ratio: 1;
}
.photo-ring::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    transparent 0% 12%, rgba(56, 189, 248, 0.95) 28%, rgba(129, 140, 248, 0.9) 42%,
    transparent 58% 70%, rgba(56, 189, 248, 0.5) 84%, transparent 96%);
  animation: ring-spin 9s linear infinite;
}
.photo-ring::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px solid rgba(125, 211, 252, 0.25);
}
@keyframes ring-spin { to { transform: rotate(360deg); } }
.photo-ring img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 14%;
  border-radius: 50%;
  background: linear-gradient(180deg, #F8FAFD, #DCE9F8);
  box-shadow: 0 0 70px rgba(56, 189, 248, 0.28), 0 24px 60px rgba(0, 0, 0, 0.45);
}
.photo-chip {
  position: absolute;
  z-index: 2;
  padding: 9px 14px;
  font-size: 0.72rem;
  color: var(--cyan-soft);
  /* Kein backdrop-filter: die Chips schweben per Endlos-Animation, ein
     Backdrop-Blur müsste dadurch jeden Frame neu sampeln. Der fast opake
     Hintergrund sieht identisch aus. */
  background: rgba(11, 21, 38, 0.93);
  border: 1px solid rgba(125, 211, 252, 0.3);
  border-radius: 999px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  animation: chip-float 5.5s ease-in-out infinite;
}
.chip-1 { top: 6%; right: -8%; animation-delay: 0s; }
.chip-2 { bottom: 22%; left: -16%; animation-delay: -1.8s; }
.chip-3 { bottom: -2%; right: 2%; animation-delay: -3.6s; }
@keyframes chip-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 2;
  width: 26px;
  height: 42px;
  border: 2px solid rgba(125, 211, 252, 0.4);
  border-radius: 14px;
  display: flex;
  justify-content: center;
}
.scroll-wheel {
  width: 4px;
  height: 9px;
  margin-top: 7px;
  border-radius: 3px;
  background: var(--cyan-soft);
  animation: wheel 1.8s ease-in-out infinite;
}
@keyframes wheel {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ---------- Page-Body & Daten-Linie ---------- */
#page-body { position: relative; }
#data-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
}
html:not(.js-anim) #data-line { display: none; }
.dl-path {
  fill: none;
  stroke: url(#dlGrad);
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.22;
}
/* Glow ohne filter:blur() — der Pfad überspannt die ganze Seite und sein
   stroke-dashoffset ändert sich bei jedem Scroll-Frame; ein SVG-Blur müsste
   dann jedes Mal neu gerendert werden (Firefox bricht dabei ein). Breiter,
   transparenter Strich erzeugt denselben Halo praktisch gratis. */
.dl-path-glow {
  fill: none;
  stroke: url(#dlGrad);
  stroke-width: 7;
  stroke-linecap: round;
  opacity: 0.03;
}
.dl-node {
  fill: var(--bg-1);
  stroke: rgba(125, 211, 252, 0.45);
  stroke-width: 2;
  transition: fill 0.4s ease, stroke 0.4s ease;
}
.dl-node.active {
  fill: var(--cyan);
  stroke: var(--cyan-soft);
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.9));
}
.dl-head {
  fill: #7DD3FC;
  filter: drop-shadow(0 0 5px rgba(125, 211, 252, 0.6));
}

/* ---------- Sektionen allgemein ---------- */
.section { position: relative; padding: clamp(4.5rem, 9vw, 7.5rem) 0; }
.section .container { position: relative; z-index: 1; }
.sec-label {
  color: var(--cyan-soft);
  font-size: 0.8rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.sec-lead {
  max-width: 620px;
  font-size: 1.05rem;
  margin-bottom: 2.6rem;
}

/* ---------- 01 Über mich ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(32px, 5vw, 64px);
  margin-top: 2.2rem;
  align-items: start;
}
.about-text p { margin-bottom: 1.2rem; }
.about-points { margin-top: 1.6rem; display: grid; gap: 12px; }
.about-points li {
  display: flex;
  gap: 12px;
  align-items: baseline;
  color: var(--text-0);
  font-weight: 600;
  font-size: 0.97rem;
}
.point-icon { color: var(--cyan); }

.about-stats { display: grid; gap: 18px; }
.stat-card {
  padding: 26px 28px;
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.stat-card:hover { border-color: rgba(56, 189, 248, 0.4); transform: translateY(-3px); }
.stat-num {
  display: block;
  font-size: 2.7rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 6px;
}
.stat-label { font-size: 0.9rem; color: var(--text-2); }

/* ---------- 02 Skills ---------- */
.skill-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 2rem;
}
.filter-chip {
  padding: 9px 18px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-1);
  background: rgba(16, 27, 46, 0.6);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.filter-chip:hover { color: var(--cyan-soft); border-color: rgba(56, 189, 248, 0.4); }
.filter-chip.active {
  background: var(--grad-btn);
  border-color: transparent;
  color: #fff;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.skill-card {
  position: relative;
  padding: 20px 20px 18px;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.skill-card h3 { font-size: 1rem; margin-bottom: 5px; }
.skill-card p { font-size: 0.84rem; color: var(--text-2); line-height: 1.5; }
.skill-dot {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.skill-card[data-cat="m365"] .skill-dot { background: var(--c-m365); box-shadow: 0 0 9px var(--c-m365); }
.skill-card[data-cat="ki"] .skill-dot { background: var(--c-ki); box-shadow: 0 0 9px var(--c-ki); }
.skill-card[data-cat="sec"] .skill-dot { background: var(--c-sec); box-shadow: 0 0 9px var(--c-sec); }
.skill-card[data-cat="infra"] .skill-dot { background: var(--c-infra); box-shadow: 0 0 9px var(--c-infra); }
.skill-card[data-cat="m365"]:hover { border-color: rgba(56, 189, 248, 0.5); box-shadow: 0 10px 34px rgba(56, 189, 248, 0.12); transform: translateY(-4px); }
.skill-card[data-cat="ki"]:hover { border-color: rgba(167, 139, 250, 0.5); box-shadow: 0 10px 34px rgba(167, 139, 250, 0.12); transform: translateY(-4px); }
.skill-card[data-cat="sec"]:hover { border-color: rgba(251, 191, 36, 0.5); box-shadow: 0 10px 34px rgba(251, 191, 36, 0.1); transform: translateY(-4px); }
.skill-card[data-cat="infra"]:hover { border-color: rgba(52, 211, 153, 0.5); box-shadow: 0 10px 34px rgba(52, 211, 153, 0.12); transform: translateY(-4px); }
.skill-card.filtered-out { display: none; }

.skill-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 1.8rem;
  font-size: 0.75rem;
  color: var(--text-2);
}
.legend-item { display: inline-flex; align-items: center; gap: 8px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-m365 { background: var(--c-m365); }
.dot-ki { background: var(--c-ki); }
.dot-sec { background: var(--c-sec); }
.dot-infra { background: var(--c-infra); }

/* ---------- 03 Services ---------- */
.svc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.svc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  transform-style: preserve-3d;
}
.svc-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 18px 50px rgba(8, 47, 87, 0.45);
}

/* Hervorgehobene USP-Karte (KI-gestützte Entwicklung) */
.svc-featured {
  grid-column: 1 / -1;
  border-color: rgba(129, 140, 248, 0.45);
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.09), rgba(129, 140, 248, 0.07) 55%, rgba(11, 18, 32, 0)),
    rgba(15, 23, 42, 0.55);
}
.svc-featured:hover {
  border-color: rgba(129, 140, 248, 0.7);
  box-shadow: 0 18px 50px rgba(67, 56, 202, 0.35);
}
.svc-featured > p { max-width: 70ch; }
.svc-featured .svc-icon {
  background: rgba(129, 140, 248, 0.12);
  border-color: rgba(129, 140, 248, 0.3);
}
.svc-flag {
  align-self: flex-start;
  font-size: 0.74rem;
  letter-spacing: 0.6px;
  color: var(--violet);
  padding: 5px 12px;
  border: 1px solid rgba(129, 140, 248, 0.35);
  border-radius: 999px;
  background: rgba(129, 140, 248, 0.1);
}
.tilt::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%),
    rgba(125, 211, 252, 0.1), transparent 65%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.tilt:hover::after { opacity: 1; }
.svc-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--cyan-soft);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
}
.svc-icon svg { width: 26px; height: 26px; }
.svc-card h3 { font-size: 1.13rem; }
.svc-card > p { font-size: 0.93rem; flex-grow: 1; }
.svc-toggle {
  align-self: flex-start;
  background: none;
  border: none;
  padding: 4px 0;
  color: var(--cyan-soft);
  font-size: 0.8rem;
  cursor: pointer;
  transition: color 0.25s ease;
}
.svc-toggle:hover { color: var(--cyan); text-decoration: underline; text-underline-offset: 4px; }
.svc-details {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s ease;
}
.svc-details ul {
  overflow: hidden;
  min-height: 0;
  display: grid;
  gap: 8px;
}
.svc-card.open .svc-details { grid-template-rows: 1fr; }
.svc-details li {
  position: relative;
  padding-left: 18px;
  font-size: 0.87rem;
  color: var(--text-1);
}
.svc-details li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--cyan);
}
.svc-card.open .svc-details ul { padding-top: 6px; }

.svc-note {
  margin-top: 26px;
  padding: 24px 28px;
  display: grid;
  gap: 8px;
}
.note-tag { color: var(--cyan-soft); font-size: 0.78rem; letter-spacing: 1px; }
.svc-note p { font-size: 0.95rem; }

/* ---------- 04 Werdegang ---------- */
.timeline {
  position: relative;
  max-width: 780px;
  margin-top: 2.4rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--violet) 55%, rgba(125, 211, 252, 0.12));
}
.tl-entry { position: relative; padding: 0 0 2.6rem 46px; }
.tl-entry:last-child { padding-bottom: 0.5rem; }
.tl-dot {
  position: absolute;
  left: 0;
  top: 5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  background: var(--bg-1);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.55);
}
.tl-entry[data-type="edu"] .tl-dot {
  border-color: var(--c-ki);
  box-shadow: 0 0 14px rgba(167, 139, 250, 0.55);
}
.tl-date { font-size: 0.78rem; color: var(--cyan-soft); letter-spacing: 0.8px; margin-bottom: 6px; }
.tl-entry[data-type="edu"] .tl-date { color: var(--c-ki); }
.tl-entry h3 { font-size: 1.18rem; margin-bottom: 3px; }
.tl-org { font-size: 0.9rem; color: var(--text-2); margin-bottom: 10px; }
.tl-points { display: grid; gap: 6px; }
.tl-points li {
  position: relative;
  padding-left: 18px;
  font-size: 0.92rem;
}
.tl-points li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
}
.tl-entry[data-type="edu"] .tl-points li::before { background: var(--c-ki); }
.tl-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tl-tag {
  font-size: 0.72rem;
  color: #C4B5FD;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.3);
}
.tl-compact h3 { font-size: 1.02rem; }
.tl-compact { padding-bottom: 2rem; }

/* ---------- 05 Zertifikate & Sprachen ---------- */
.cert-lang-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
  margin-top: 2.2rem;
  align-items: start;
}
.cert-col { display: grid; gap: 16px; }
.cert-badge {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 24px;
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.cert-badge:hover { border-color: rgba(56, 189, 248, 0.4); transform: translateX(4px); }
.cert-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--cyan-soft);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
}
.cert-icon svg { width: 24px; height: 24px; }
.cert-badge h3 { font-size: 1rem; margin-bottom: 2px; }
.cert-badge p { font-size: 0.85rem; color: var(--text-2); }

.lang-col { padding: 26px 28px; }
.lang-title { color: var(--cyan-soft); font-size: 0.85rem; letter-spacing: 1px; margin-bottom: 18px; }
.lang-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 0;
}
.lang-name { flex: 1; color: var(--text-0); font-weight: 600; font-size: 0.95rem; }
.lang-dots { display: flex; gap: 6px; }
.lang-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(125, 211, 252, 0.15);
  transform: scale(0.7);
  transition: background 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease;
}
.lang-dots i.filled {
  background: var(--cyan);
  transform: scale(1);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.7);
}
.lang-level { width: 30px; text-align: right; color: var(--cyan-soft); font-size: 0.8rem; }
.lang-note { margin-top: 16px; font-size: 0.85rem; color: var(--text-2); }

/* ---------- 06 Kontakt ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: clamp(32px, 5vw, 60px);
  margin-top: 2.2rem;
  align-items: start;
}
.contact-info > p { font-size: 1.05rem; margin-bottom: 1.8rem; }
.contact-channels { display: grid; gap: 14px; }
.contact-channel {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  text-decoration: none;
  color: var(--text-1);
  transition: border-color 0.3s ease, transform 0.3s ease;
}
a.contact-channel:hover { border-color: rgba(56, 189, 248, 0.45); transform: translateY(-2px); }
.channel-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--cyan-soft);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
}
.channel-icon svg { width: 22px; height: 22px; }
.contact-channel strong { display: block; font-size: 0.95rem; }
.channel-value { display: block; font-size: 0.82rem; color: var(--cyan-soft); margin-top: 2px; }

#contact-form { padding: clamp(22px, 4vw, 34px); display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-field label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-2);
  margin-bottom: 7px;
  letter-spacing: 0.3px;
}
.req { color: var(--cyan); }
.opt { color: var(--text-2); font-size: 0.75rem; }
.form-field input,
.form-field textarea {
  width: 100%;
  padding: 13px 15px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-0);
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  resize: vertical;
}
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}
#form-status { display: none; font-size: 0.92rem; font-weight: 600; }
#form-status.ok { display: block; color: #34D399; }
#form-status.err { display: block; color: #FB7185; }
.form-privacy { font-size: 0.78rem; color: var(--text-2); }
.form-privacy a { color: var(--cyan-soft); }

/* ---------- Footer ---------- */
#site-footer {
  border-top: 1px solid var(--line);
  padding: 42px 0;
  background: rgba(7, 13, 24, 0.6);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.footer-logo { color: var(--text-0); font-size: 0.9rem; }
.footer-meta { font-size: 0.85rem; color: var(--text-2); }
.footer-links { display: flex; gap: 22px; }
.footer-links a {
  color: var(--text-1);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.25s ease;
}
.footer-links a:hover { color: var(--cyan-soft); }
.footer-note { width: 100%; font-size: 0.72rem; color: var(--text-2); }

#to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: var(--cyan-soft);
  background: rgba(13, 22, 38, 0.8);
  border: 1px solid var(--line);
  border-radius: 50%;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s, border-color 0.3s ease;
}
#to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
#to-top:hover { border-color: rgba(56, 189, 248, 0.5); }
#to-top svg { width: 20px; height: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .skill-grid { grid-template-columns: repeat(3, 1fr); }
  .svc-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 859px) {
  /* Toggle above the full-screen menu overlay (z-index 300) */
  #nav-toggle { display: flex; z-index: 400; }
  /* Kein inset:0 — der backdrop-filter der gescrollten Nav macht sie zum
     Bezugsrahmen für position:fixed, dadurch würde das Menü auf Leistenhöhe
     kollabieren. Explizite Viewport-Maße funktionieren in beiden Fällen. */
  #nav-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100svh;
    /* Above scroll-progress (z-index 200) and all page content */
    z-index: 300;
    flex-direction: column;
    justify-content: center;
    gap: 30px;
    font-size: 1.25rem;
    background: rgba(7, 13, 24, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  }
  #nav-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }

  /* ROOT CAUSE FIX: backdrop-filter on a parent makes it the containing block
     for position:fixed children — browsers then clip the overlay to the 72px
     nav height. Removing it when the menu is open restores viewport-relative
     fixed positioning. The menu's own backdrop-filter still works fine. */
  html.menu-open #site-nav,
  html.menu-open #site-nav.scrolled {
    /* transition:none — otherwise backdrop-filter animates blur→none over
       0.35s and keeps creating a containing block (clipping the menu) the
       whole time. It must vanish on the same frame the menu opens. */
    transition: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(9, 15, 27, 0.97);
    border-bottom-color: transparent;
  }

  /* Fallback for non-iOS browsers; iOS is handled by JS (position:fixed on body) */
  html.menu-open,
  html.menu-open body { overflow: hidden; }
  .nav-link { font-size: 1.25rem; }

  .hero { padding-bottom: 70px; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-photo { margin-top: 10px; }
  .photo-ring { width: min(62vw, 270px); }
  .chip-2 { left: -6%; }
  .chip-1 { right: -2%; }

  #data-line { display: none; }

  .about-grid,
  .cert-lang-grid,
  .contact-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .stat-card { padding: 18px 16px; }
  .stat-num { font-size: 2rem; }
}

@media (max-width: 639px) {
  .skill-grid { grid-template-columns: repeat(2, 1fr); }
  .svc-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .hero-cta .btn { width: 100%; }
  .scroll-hint { display: none; }
}

@media (max-width: 419px) {
  .skill-grid { grid-template-columns: 1fr; }
}

/* ---------- Rechtsseiten (Impressum / Datenschutz) ---------- */
.legal {
  max-width: 780px;
  margin-inline: auto;
  padding: 130px 24px 80px;
}
.legal h1 { font-size: 2.1rem; margin-bottom: 0.5rem; letter-spacing: -0.5px; }
.legal-sub { color: var(--cyan-soft); font-size: 0.85rem; }
.legal h2 { font-size: 1.25rem; margin: 2.2rem 0 0.7rem; }
.legal h3 { font-size: 1.02rem; margin: 1.5rem 0 0.5rem; color: var(--cyan-soft); }
.legal p, .legal li { font-size: 0.95rem; margin-bottom: 0.8rem; }
.legal ul { list-style: disc; padding-left: 22px; }
.legal ul li { margin-bottom: 0.4rem; }
.legal a { color: var(--cyan-soft); }
.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2.2rem;
  color: var(--cyan-soft);
  text-decoration: none;
  font-size: 0.9rem;
}
.legal-back:hover { text-decoration: underline; text-underline-offset: 4px; }
/* ---------- Reduzierte Bewegung ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .typer-caret, .logo-caret { animation: none; opacity: 1; }
}

/* ═══════════════════════ KI-Chat-Overlay ═══════════════════════ */

/* Nur fuer Screenreader sichtbar. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Launcher: schwebender Button unten rechts. */
#chat-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 95;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--grad-btn);
  border: none;
  border-radius: 50%;
  box-shadow: var(--shadow-glow);
  cursor: pointer;
  transition: filter 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}
#chat-launcher:hover { filter: brightness(1.12); box-shadow: 0 12px 44px rgba(14, 165, 233, 0.55); }
#chat-launcher svg { width: 26px; height: 26px; }

/* Nach-oben-Button ueber dem Chat-Launcher stapeln (beide unten rechts). */
#to-top { bottom: 90px; }

/* Overlay + Backdrop. */
.chat-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 20px;
  background: rgba(7, 13, 24, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.chat-overlay.open { opacity: 1; }
.chat-overlay[hidden] { display: none; }

/* Chat-Fenster (nutzt die bestehende .glass-Optik). */
.chat-window {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 420px;
  height: min(640px, 86vh);
  background: linear-gradient(160deg, rgba(16, 27, 46, 0.96), rgba(11, 18, 32, 0.96));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  transform: translateY(16px);
  transition: transform 0.25s ease;
}
.chat-overlay.open .chat-window { transform: translateY(0); }

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.chat-header h2 { font-size: 1rem; margin: 0; flex: 1; }
.chat-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--c-infra);
  box-shadow: 0 0 10px var(--c-infra);
}
.chat-remaining { font-size: 0.78rem; color: var(--cyan-soft); }
.chat-close {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  font-size: 1.4rem; line-height: 1;
  color: var(--text-1);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.chat-close:hover { color: var(--text-0); border-color: rgba(56, 189, 248, 0.5); }

/* hidden-Attribut muss das explizite display der Views ueberschreiben. */
.chat-auth[hidden], .chat-main[hidden] { display: none; }

/* Login-Ansicht. */
.chat-auth {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 28px 24px;
  text-align: center;
}
.chat-auth p { color: var(--text-1); font-size: 0.95rem; max-width: 30ch; }
.chat-auth-hint { font-size: 0.74rem; color: var(--text-2); max-width: 34ch; }
#g-signin { min-height: 44px; display: flex; justify-content: center; }

/* Chat-Ansicht. */
.chat-main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overscroll-behavior: contain;
}
.chat-msg {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.chat-msg-user {
  align-self: flex-end;
  background: var(--grad-btn);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg-bot {
  align-self: flex-start;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text-0);
  border-bottom-left-radius: 4px;
}
.chat-typing { color: var(--text-2); letter-spacing: 2px; }

.chat-form {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
}
.chat-form .form-field { margin-bottom: 8px; }
.chat-form textarea {
  width: 100%;
  resize: none;
  max-height: 120px;
}
.chat-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.chat-form .btn { padding: 10px 22px; font-size: 0.95rem; }
.chat-logout {
  background: transparent;
  border: none;
  color: var(--text-2);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 6px 4px;
}
.chat-logout:hover { color: var(--cyan-soft); text-decoration: underline; text-underline-offset: 3px; }
#chat-status { margin-top: 8px; font-size: 0.85rem; font-weight: 600; min-height: 1em; }
#chat-status.ok { color: #34D399; }
#chat-status.err { color: #FB7185; }

@media (max-width: 520px) {
  .chat-overlay { padding: 0; }
  .chat-window { max-width: 100%; height: 100%; border-radius: 0; }
}
