:root {
  --bg: #0f1115;
  --bg-alt: #161a21;
  --card: #1c212b;
  --text: #e8eaf0;
  --muted: #9aa3b2;
  --accent: #4f8cff;
  --accent-2: #7c5cff;
  --border: #2a303c;
  --radius: 14px;
  --max: 1100px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* Nav */
nav { position: sticky; top: 0; z-index: 10; background: rgba(15,17,21,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-weight: 800; font-size: 1.2rem; letter-spacing: .5px; }
.logo span { color: var(--accent); }
nav ul { display: flex; gap: 28px; list-style: none; font-size: .95rem; color: var(--muted); }
nav ul a { position: relative; transition: color .2s; }
nav ul a:hover, nav ul a.active { color: var(--text); }
nav ul a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.menu-btn { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.menu-btn span { display: block; width: 22px; height: 2px; margin: 5px 0; background: var(--text); border-radius: 2px; }

/* Hero */
.hero { padding: 90px 0 80px; position: relative; overflow: hidden; }
#particles { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.hero .wrap { position: relative; z-index: 1; }
.hero .wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 60px; align-items: center; }
.eyebrow { color: var(--accent); font-weight: 600; letter-spacing: 2px; text-transform: uppercase; font-size: .85rem; }
.hero h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); line-height: 1.1; margin: 12px 0 18px; }
.grad { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { color: var(--muted); font-size: 1.15rem; max-width: 540px; }
.btns { display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }
.btn { padding: 12px 24px; border-radius: 10px; font-weight: 600; border: 1px solid var(--border); transition: .2s; display: inline-block; cursor: pointer; font: inherit; color: inherit; background: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.1); transform: translateY(-2px); }
.btn:hover { border-color: var(--accent); }
.photo { position: relative; justify-self: center; width: 100%; max-width: 340px; }
.photo img { width: 100%; height: auto; aspect-ratio: 2/3; object-fit: cover; border-radius: 24px; display: block; border: 1px solid var(--border); }
.photo::after { content: ""; position: absolute; inset: -12px; border-radius: 30px; border: 1px solid var(--accent); opacity: .35; z-index: -1; }
.quick { display: flex; gap: 32px; margin-top: 40px; color: var(--muted); font-size: .9rem; flex-wrap: wrap; }
.quick b { display: block; color: var(--text); font-size: 1.6rem; }

/* Sections */
section { padding: 90px 0; }
section.alt { background: var(--bg-alt); }
.sec-head { margin-bottom: 44px; }
.sec-head h2 { font-size: 2rem; }
.sec-head p { color: var(--muted); margin-top: 6px; }

/* About */
.about { display: grid; grid-template-columns: 1.5fr 1fr; gap: 50px; }
.about p { color: var(--muted); margin-bottom: 16px; font-size: 1.05rem; }
.facts { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; align-self: start; }
.facts div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); gap: 12px; }
.facts div:last-child { border: 0; }
.facts span:first-child { color: var(--muted); }
.facts span:last-child { text-align: right; }

/* Werdegang: Überblick Lehre */
.lehre { margin-bottom: 48px; background: linear-gradient(160deg, rgba(79,140,255,.10), var(--card) 60%); }
.lehre:hover { transform: none; }
.lehre-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 26px; }
.lehre-head h3 { font-size: 1.35rem; margin-bottom: 4px; }
.lehre-head p { margin: 0; }
.lehre-year { text-align: right; flex-shrink: 0; }
.lehre-year b { display: block; font-size: 2.6rem; line-height: 1; background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lehre-year span { color: var(--muted); font-size: .85rem; }
.lehre-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.lehre-step span { display: block; margin-top: 10px; font-weight: 600; font-size: .9rem; color: var(--muted); }
.lehre-step small { color: var(--muted); font-size: .8rem; opacity: .7; }
.lehre-step.is-done span, .lehre-step.is-current span { color: var(--text); }
.lehre-step.is-current span::after { content: " · jetzt"; color: #6ee7b7; font-weight: 600; }
.ls-bar { height: 8px; border-radius: 8px; background: var(--bg-alt); border: 1px solid var(--border); overflow: hidden; }
.ls-fill { height: 100%; width: 0; border-radius: 8px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 1.4s cubic-bezier(.2,.8,.2,1); }

/* Werdegang: Phasen pro Lehrjahr */
.phases { position: relative; }
.phases::before { content: ""; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 2px; background: linear-gradient(var(--accent), var(--border)); }
.phase { display: grid; grid-template-columns: 210px 1fr; gap: 28px; padding-bottom: 32px; }
.phase:last-child { padding-bottom: 0; }
.phase-label { position: relative; padding-left: 34px; }
.phase-dot { position: absolute; left: 0; top: 5px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); }
.phase-dot.is-current { background: var(--accent); box-shadow: 0 0 0 5px rgba(79,140,255,.2); }
.phase-title { font-size: 1.25rem; font-weight: 800; }
.phase-years { color: var(--muted); font-size: .9rem; margin-bottom: 8px; }
.phase-entries { display: grid; gap: 10px; align-content: start; }

/* Kompakte Zeile: Art · Titel · Datum · Pfeil */
.tl-entry {
  display: grid; grid-template-columns: 140px 1fr auto 18px; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--type, var(--accent));
  border-radius: 12px; padding: 13px 18px; transition: .2s;
}
a.tl-entry:hover { border-color: var(--type, var(--accent)); background: color-mix(in srgb, var(--type, var(--accent)) 8%, var(--card)); transform: translateX(4px); }
.tl-entry h4 { font-size: 1rem; margin: 0; }
.tl-type { justify-self: start; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--type, var(--accent)); background: color-mix(in srgb, var(--type, var(--accent)) 14%, transparent); padding: 3px 9px; border-radius: 999px; }
.tl-date { color: var(--muted); font-size: .85rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-arrow { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: .2s; }
a.tl-entry:hover .tl-arrow { stroke: var(--type, var(--accent)); transform: translateX(3px); }

/* Sprungziel kurz aufleuchten lassen */
[id] { scroll-margin-top: 84px; }
.card:target, .proj-group:target { animation: targetFlash 2.2s ease; }
@keyframes targetFlash {
  0%, 35% { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(79,140,255,.35); }
  100% { box-shadow: 0 0 0 0 rgba(79,140,255,0); }
}
.type-betrieb { --type: #4f8cff; }
.type-schule  { --type: #a78bfa; }
.type-uek     { --type: #34d399; }
.type-start   { --type: #9aa3b2; }

/* Button nach oben */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 20; width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 24px rgba(79,140,255,.35); opacity: 0; pointer-events: none; transform: translateY(12px); transition: .25s;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { transform: translateY(-3px); filter: brightness(1.1); }
.to-top svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* Cards / Skills */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; transition: .2s; }
.card:hover { border-color: var(--accent); transform: translateY(-3px); }
.card h3 { margin-bottom: 10px; font-size: 1.1rem; }
.card p { color: var(--muted); font-size: .95rem; margin-bottom: 14px; }
.card .meta { color: var(--accent); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background: rgba(79,140,255,.12); color: #a9c4ff; padding: 5px 12px; border-radius: 999px; font-size: .85rem; }
/* Aktuelles Projekt hervorheben */
.card-current { border-color: rgba(79,140,255,.55); background: linear-gradient(160deg, rgba(79,140,255,.12), var(--card) 55%); }
.live-badge {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  display: flex; width: fit-content; align-items: center; gap: 6px; margin-bottom: 10px; padding: 3px 10px;
  border-radius: 999px; background: rgba(52,211,153,.14); color: #6ee7b7; letter-spacing: .5px;
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,.6); } 70% { box-shadow: 0 0 0 7px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }

/* Skills */
.skills-layout { display: grid; grid-template-columns: 1.25fr 1fr; gap: 22px; }
.skills-layout .card:hover { transform: none; }
.skills-layout h3 { margin-bottom: 22px; }
.skill-strengths { grid-column: 1 / -1; }

.skill { margin-bottom: 20px; }
.skill:last-child { margin-bottom: 0; }
.skill-top { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; font-size: .95rem; }
.skill-top .pct { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.skill-track { position: relative; height: 10px; margin-top: 8px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.skill-track::after { /* Skala in 25% Schritten */
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), rgba(255,255,255,.06) calc(25% - 1px) 25%);
  pointer-events: none;
}
.skill-fill {
  position: relative; height: 100%; width: 0; border-radius: 10px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px rgba(79,140,255,.45);
  transition: width 1.4s cubic-bezier(.2,.8,.2,1);
  overflow: hidden;
}
.skill-fill::after { /* Lichtreflex, der über den Balken läuft */
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  animation: shine 2.8s ease-in-out infinite 1.6s; transform: translateX(-120%);
}
@keyframes shine { 0% { transform: translateX(-120%); } 60%, 100% { transform: translateX(320%); } }

.rings { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 12px; }
.ring { text-align: center; }
.ring-chart { position: relative; width: 112px; height: 112px; margin: 0 auto 10px; }
.ring-chart svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--bg-alt); stroke-width: 9; }
.ring-fg {
  fill: none; stroke: url(#ringGrad); stroke-width: 9; stroke-linecap: round;
  stroke-dasharray: 326.73; stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 1.6s cubic-bezier(.2,.8,.2,1);
  filter: drop-shadow(0 0 6px rgba(79,140,255,.45));
}
.ring-val { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ring-name { font-weight: 600; }
.ring-lvl { color: var(--muted); font-size: .85rem; }

.strengths { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.strength {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; font-weight: 600;
  background: rgba(79,140,255,.07); border: 1px solid var(--border); border-radius: 12px; transition: .2s;
}
.strength:hover { border-color: var(--accent); background: rgba(79,140,255,.13); transform: translateY(-2px); }
.strength svg { width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Project groups */
.proj-group { display: flex; align-items: center; gap: 12px; font-size: 1.25rem; margin: 48px 0 20px; }
.sec-head + .proj-group { margin-top: 0; }

/* Contact */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: start; }
.contact-list a, .contact-list div { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; transition: .2s; word-break: break-all; }
.contact-list a:hover { border-color: var(--accent); }
.lbl-sm { display: block; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: 1px; word-break: normal; }
.icon { width: 40px; height: 40px; border-radius: 10px; background: rgba(79,140,255,.15); display: grid; place-items: center; color: var(--accent); flex-shrink: 0; }
.icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cta { background: linear-gradient(135deg, rgba(79,140,255,.15), rgba(124,92,255,.15)); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
.cta h3 { font-size: 1.4rem; margin-bottom: 10px; }
.cta p { color: var(--muted); margin-bottom: 22px; }

footer { border-top: 1px solid var(--border); padding: 30px 0; color: var(--muted); font-size: .9rem; }
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
footer a:hover { color: var(--text); }

/* Legal pages */
.legal { padding: 70px 0; max-width: 760px; }
.legal h1 { font-size: 2.2rem; margin-bottom: 30px; }
.legal h2 { font-size: 1.2rem; margin: 30px 0 10px; }
.legal p, .legal li { color: var(--muted); margin-bottom: 10px; }
.legal ul { margin-left: 20px; }
.legal a { color: var(--accent); }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }
.reveal.show { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .skill-fill, .ring-fg { transition: none; }
  .skill-fill::after { animation: none; display: none; }
  .live-dot { animation: none; }
  .ls-fill { transition: none; }
  a.tl-entry:hover, a.tl-entry:hover .tl-arrow, .to-top, .to-top:hover { transform: none; }
  .card:target, .proj-group:target { animation: none; }
}

@media (max-width: 820px) {
  nav ul { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg); flex-direction: column; padding: 20px 24px; gap: 16px; border-bottom: 1px solid var(--border); }
  nav ul.open { display: flex; }
  .menu-btn { display: block; }
  .hero { padding: 50px 0 60px; }
  .hero .wrap, .about, .contact { grid-template-columns: 1fr; gap: 36px; }
  .skills-layout { grid-template-columns: 1fr; }
  .phase { grid-template-columns: 1fr; gap: 14px; }
  .phase-entries { padding-left: 34px; }
  .tl-entry { grid-template-columns: 1fr 18px; grid-template-areas: "type arrow" "title arrow" "date arrow"; gap: 4px 12px; padding: 12px 14px; }
  .tl-type { grid-area: type; }
  .tl-entry h4 { grid-area: title; }
  .tl-date { grid-area: date; }
  .tl-arrow { grid-area: arrow; }
  nav ul a.active { color: var(--accent); }
  nav ul a.active::after { display: none; }
  .to-top { right: 16px; bottom: 16px; width: 44px; height: 44px; }
  .lehre-head { flex-direction: column; gap: 12px; }
  .lehre-year { text-align: left; display: flex; align-items: baseline; gap: 8px; }
  .lehre-steps { grid-template-columns: 1fr 1fr; gap: 14px 10px; }
  .ring-chart { width: 96px; height: 96px; }
  .strengths { display: flex; flex-wrap: wrap; gap: 10px; }
  .strength { padding: 10px 14px; gap: 8px; font-size: .92rem; }
  .strength svg { width: 18px; height: 18px; }
  .photo { max-width: 240px; order: -1; }
  section { padding: 64px 0; }
}
