/* ============================================================
   Komponenten: LED, Navigation, Status-Leiste, Buttons,
   Badge, Caret, Cursor
   ============================================================ */

/* ---------- LED ---------- */
.led {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--volt);
  box-shadow: 0 0 6px var(--volt), 0 0 12px rgba(var(--volt-rgb), .5);
}
.led--pulse { animation: led-pulse 1.6s ease-in-out infinite; }
.led--amber { background: var(--amber); box-shadow: 0 0 6px var(--amber); }

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  background: var(--nav);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
  padding: 0 var(--pad-x);
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -.02em;
}
.nav__logo {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border: 1px solid var(--volt);
  color: var(--volt);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  box-shadow: inset 0 0 12px rgba(var(--volt-rgb), .12), 0 0 10px rgba(var(--volt-rgb), .12);
}
.nav__right { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 28px); }
.nav__links { display: flex; align-items: center; gap: clamp(12px, 1.6vw, 24px); }
.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color .25s;
}
.nav__link:hover, .nav__link.is-active { color: var(--fg); }
.nav__idx { color: var(--muted); font-size: 10px; transition: color .25s; }
.nav__link.is-active .nav__idx { color: var(--volt); }

.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  transition: border-color .2s;
}
.btn-pill:hover { border-color: var(--volt); }
.lang-sep { color: var(--muted-2); }
.lang-de.is-on, .lang-en.is-on { color: var(--volt); }
.lang-de:not(.is-on), .lang-en:not(.is-on) { color: var(--muted); }

/* Hamburger (nur unter 960px sichtbar) */
.nav__burger {
  display: none;
  position: relative;
  width: 40px; height: 38px;
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
}
.nav__burger span {
  position: absolute;
  left: 10px; right: 10px;
  height: 2px;
  background: var(--fg);
  border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease, top .25s ease;
}
.nav__burger span:nth-child(1) { top: 13px; }
.nav__burger span:nth-child(2) { top: 18px; }
.nav__burger span:nth-child(3) { top: 23px; }
.nav__burger.is-open span:nth-child(1) { top: 18px; transform: rotate(45deg); }
.nav__burger.is-open span:nth-child(2) { opacity: 0; }
.nav__burger.is-open span:nth-child(3) { top: 18px; transform: rotate(-45deg); }

/* ---------- Status-Leiste ---------- */
.status {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
  height: 28px;
  padding: 0 var(--pad-x);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.status__item { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.status__item--section { margin-left: auto; }
.status__sys { color: var(--volt); }
.status__clock { color: var(--fg); font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 14px 22px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: transform .25s var(--ease-out), box-shadow .25s, border-color .25s, color .25s;
  will-change: transform;
}
.btn--primary {
  background: var(--volt);
  color: #050607;
}
.btn--primary:hover {
  box-shadow: 0 0 24px rgba(var(--volt-rgb), .35), 0 10px 30px -10px rgba(var(--volt-rgb), .6);
}
/* Blitz-Icon statt Emoji */
.btn--primary::after {
  content: "";
  width: 11px; height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 14'%3E%3Cpath d='M6.5 0 L0 8 H4.5 L3.5 14 L11 5.5 H6.2 Z' fill='%23050607'/%3E%3C/svg%3E") center / contain no-repeat;
}
.btn--ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--line-2);
}
.btn--ghost:hover { border-color: var(--volt); color: var(--volt); }

/* ---------- Badge ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  color: var(--muted);
  font-size: 10.5px;
}

/* ---------- Caret ---------- */
.caret {
  display: inline-block;
  width: .55em; height: 1.05em;
  margin-left: 3px;
  vertical-align: -.15em;
  background: var(--volt);
  animation: caret-blink 1s steps(2) infinite;
}

/* ---------- Strom-Cursor v2 ---------- */
@media (hover: hover) and (pointer: fine) {
  .has-custom-cursor,
  .has-custom-cursor a,
  .has-custom-cursor button { cursor: none !important; }
}

/* ---------- Terminal-Button ---------- */
.btn-term { color: var(--volt); font-weight: 700; letter-spacing: 0; padding: 6px 10px; }
.btn-term:hover { box-shadow: 0 0 12px rgba(var(--volt-rgb), .35); }

/* ---------- Status-Log ---------- */
.status__item--log { color: var(--muted-2); min-width: 0; }
.status__log-k { color: var(--volt); }
#statusLog { transition: color .3s; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
#statusLog.is-flash { color: var(--fg); }

/* ---------- Terminal ---------- */
.term {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 6, 7, .6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .2s;
}
.term[hidden] { display: none; }
.term.is-open { opacity: 1; }
.term__win {
  width: min(680px, 100%);
  height: min(70vh, 560px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: rgba(8, 10, 12, .97);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .9), 0 0 60px rgba(var(--volt-rgb), .08);
  transform: translateY(12px) scale(.98);
  transition: transform .2s var(--ease-out);
  overflow: hidden;
}
.term.is-open .term__win { transform: none; }
.term__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.term__dots { display: inline-flex; gap: 6px; }
.term__dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted-2); }
.term__dots i:first-child { background: var(--amber); }
.term__dots i:nth-child(2) { background: var(--volt); }
.term__title { flex: 1; }
.term__close { background: transparent; border: 0; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 4px; }
.term__close:hover { color: var(--fg); }
.term__out {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--fg);
  white-space: pre-wrap;
}
.term__row { word-break: break-word; }
.term__row--cmd { color: var(--volt); margin-top: 6px; }
.term__row--muted { color: var(--muted); }
.term__row--ok { color: var(--volt); }
.term__row--err { color: var(--amber); }
.term__line { display: flex; align-items: center; gap: 10px; padding: 8px 16px 14px; border-top: 1px solid var(--line); }
.term__prompt { color: var(--volt); font-family: var(--font-mono); }
.term__input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 13px;
  caret-color: var(--volt);
}

/* Touch: 16px verhindert den Auto-Zoom von iOS beim Fokus */
@media (hover: none) {
  .term__input { font-size: 16px; }
  .term__out { font-size: 14px; }
}

/* ---------- Fullscreen-Matrix (Terminal "matrix", Konami) ---------- */
.matrix-burst {
  position: fixed;
  inset: 0;
  z-index: 700;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity .6s;
}
.matrix-burst.is-on { opacity: .85; }

/* ---------- CRT: feine Scanlines + wandernder Lichtbalken ---------- */
.crt { position: fixed; inset: 0; z-index: 600; pointer-events: none; }
.crt::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .022) 0 1px, transparent 1px 3px);
}
.crt::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 140px;
  top: -20%;
  background: linear-gradient(180deg, transparent, rgba(var(--volt-rgb), .05), transparent);
  animation: crt-sweep 9s linear infinite;
}

/* ---------- Hex-Datenstrom am linken Rand ---------- */
.hexstream {
  position: fixed;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .08em;
  color: var(--muted-2);
  opacity: .6;
  pointer-events: none;
}
.hexstream span { transition: color .3s; }
.hexstream span.is-hot { color: var(--volt); }
@media (max-width: 1180px) { .hexstream { display: none; } }

/* ---------- Status-Leiste: Uptime, Terminal-Hinweis, Scroll-Fortschritt ---------- */
.status__item--up { color: var(--muted-2); }
#statusUp { color: var(--muted); font-variant-numeric: tabular-nums; }
.status__item--hint { color: var(--muted-2); }
.status__item--hint b { color: var(--volt); font-weight: 600; }
.progress {
  position: absolute;
  left: 0; bottom: -1px;
  height: 1px;
  width: var(--p, 0%);
  background: linear-gradient(90deg, rgba(var(--volt-rgb), .3), var(--volt));
  box-shadow: 0 0 8px rgba(var(--volt-rgb), .6);
  transition: width .15s linear;
}
@media (max-width: 1100px) { .status__item--hint, .status__item--up { display: none; } }

/* ---------- Sektionstitel: Befehlszeile tippt sich beim Reveal ein ---------- */
.section-head::after { order: 1; }
.section-head__cmd {
  order: 2;
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--muted-2);
  white-space: nowrap;
}
.section-head__ok { order: 3; font-size: 11px; color: var(--volt); }
@media (max-width: 760px) { .section-head__cmd, .section-head__ok { display: none; } }

/* ---------- HUD-Eckklammern auf Karten beim Hover ---------- */
.fact::before, .hobby::before, .stack-card::before {
  --c: rgba(var(--volt-rgb), .85);
  --l: 12px;
  content: "";
  position: absolute;
  inset: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s;
  background:
    linear-gradient(var(--c), var(--c)) left top / var(--l) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) left top / 1px var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) right top / var(--l) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) right top / 1px var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) left bottom / var(--l) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) left bottom / 1px var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) right bottom / var(--l) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) right bottom / 1px var(--l) no-repeat;
}
.fact:hover::before, .hobby:hover::before, .stack-card:hover::before { opacity: 1; }

/* ---------- Karten-Tilt: Glanzpunkt folgt der Maus ---------- */
[data-tilt] { position: relative; will-change: transform; }
[data-tilt]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(260px circle at var(--gx, 50%) var(--gy, 50%), rgba(var(--volt-rgb), .10), transparent 60%);
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
}
[data-tilt].is-tilting::after { opacity: 1; }
.cursor-dot, .cursor-ring, .cursor-fx {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
}
.cursor-fx { width: 100vw; height: 100vh; z-index: 9998; }
.cursor-dot {
  z-index: 10000;
  width: 8px; height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--volt);
  box-shadow: 0 0 8px var(--volt), 0 0 16px rgba(var(--volt-rgb), .6);
  transition: opacity .2s;
}
.cursor-ring {
  z-index: 9999;
  width: 34px; height: 34px;
  margin: -17px 0 0 -17px;
  transition: width .2s, height .2s, margin .2s, opacity .2s;
}
.cursor-ring__inner {
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 1px dashed rgba(var(--volt-rgb), .85);
  animation: spin 4s linear infinite;
  transition: border-color .2s, background .2s;
}
.cursor-ring.is-hot { width: 54px; height: 54px; margin: -27px 0 0 -27px; }
.cursor-ring.is-hot .cursor-ring__inner {
  border-style: solid;
  border-color: var(--amber);
  background: rgba(var(--amber-rgb), .08);
}

/* ============================================================
   Responsive: Navigation unter 1100px als Hamburger-Panel
   ============================================================ */
@media (max-width: 1100px) {
  .nav__right { gap: 10px; }
  .nav__burger { display: inline-flex; }
  .nav__links {
    position: absolute;
    top: 60px;
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px var(--pad-x) 14px;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    background: var(--nav);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 26px 44px -30px rgba(0, 0, 0, .8);
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s;
  }
  .nav__links.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity .25s ease, transform .25s ease;
  }
  .nav__link { padding: 14px 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
  .nav__links .nav__link:last-child { border-bottom: none; }
  .status { gap: 14px; }
  .status__city, .status__item--log { display: none; }
}

@media (max-width: 480px) {
  .status { font-size: 10px; letter-spacing: .06em; gap: 12px; }
  #statusUtc { display: none; }
}
/* Kleine Handys: Markenname ausblenden, damit Terminal, Sprache und Menü Platz haben */
@media (max-width: 480px) {
  /* Name bleibt im Zugänglichkeitsbaum, nur visuell versteckt */
  .nav__name { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nav__right { gap: 8px; }
  .nav__links { background: rgba(5, 6, 7, .94); }
}
@media (max-width: 400px) {
  .nav__logo { width: 30px; height: 30px; font-size: 11px; }
  .btn-pill { padding: 6px 9px; }
}
