/* ============================================================
   Sektionen: Boot-Sequenz, Hintergrund, Hero, 3D-Bühne
   ============================================================ */

/* ---------- Boot-Sequenz ---------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: #000;
}
.boot__log {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(12px, 1.4vw, 15px);
  line-height: 1.75;
  color: var(--volt);
  white-space: pre;
  /* feste Box: Tippen und Font-Swap verschieben nichts */
  width: min(88vw, 420px);
  height: 9em;
  overflow: hidden;
  text-shadow: 0 0 8px rgba(var(--volt-rgb), .45);
}
.boot__skip {
  position: absolute;
  right: 28px; bottom: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.boot.is-flash { background: #fff; }
.boot.is-flash .boot__log,
.boot.is-flash .boot__skip { opacity: 0; }

/* ---------- Hintergrund: Chrom-Schlieren, Lichtstreifen, Grain ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--bg);
}
.bg__layer {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  will-change: transform;
}
.bg__layer--1 {
  width: 70vmax; height: 70vmax; left: -20vmax; top: -30vmax;
  background: radial-gradient(closest-side, #161c23, transparent 72%);
  animation: bg-drift-1 38s ease-in-out infinite alternate;
}
.bg__layer--2 {
  width: 85vmax; height: 60vmax; right: -30vmax; top: 5vmax;
  background: radial-gradient(closest-side, #10161c, transparent 72%);
  animation: bg-drift-2 46s ease-in-out infinite alternate;
}
.bg__layer--3 {
  width: 60vmax; height: 60vmax; left: 15vmax; bottom: -35vmax;
  background: radial-gradient(closest-side, #11151b, transparent 72%);
  animation: bg-drift-3 52s ease-in-out infinite alternate;
}
.bg__streak {
  position: absolute;
  left: -20%;
  width: 140%;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .05) 30%, rgba(255, 255, 255, .16) 50%, rgba(255, 255, 255, .05) 70%, transparent);
  filter: blur(4px);
  will-change: transform, opacity;
}
.bg__streak--1 { top: 30%; animation: streak-drift 28s ease-in-out infinite; }
.bg__streak--2 { top: 62%; animation: streak-drift 36s ease-in-out 9s infinite; opacity: .5; }
.bg__grain {
  position: absolute;
  inset: 0;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 240px 240px;
  mix-blend-mode: screen;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: min(100vh, 900px);
  min-height: min(100svh, 900px);
  display: flex;
  flex-direction: column;
  /* Oben ausgerichtet statt zentriert: Höhenänderungen der Textspalte (Font-Swap)
     verschieben so weder Foto noch Canvas, also kein Layout-Shift */
  justify-content: flex-start;
  padding: calc(var(--nav-h) + clamp(36px, 7vh, 90px)) var(--pad-x) 28px;
}
.hero__matrix {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .36;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(85% 80% at 72% 45%, #000 0%, rgba(0, 0, 0, .45) 45%, transparent 82%);
  mask-image: radial-gradient(85% 80% at 72% 45%, #000 0%, rgba(0, 0, 0, .45) 45%, transparent 82%);
}
.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: start;
  gap: clamp(28px, 5vw, 70px);
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
}
.hero__kicker { color: var(--muted); margin-bottom: 18px; min-height: 1.5em; }
.hero__name {
  font-weight: 800;
  font-size: clamp(60px, 11vw, 150px);
  line-height: .86;
  letter-spacing: -.04em;
}
/* Höhere Spezifität als .glitch (inline-block): die zwei Zeilen bleiben immer zwei Zeilen,
   auch wenn der Scramble kurz schmalere Zeichen zeigt */
.hero__name .hero__name-line { display: block; }
.hero__name-line--outline {
  color: transparent;
  -webkit-text-stroke: 2px var(--volt);
}
.glitch { position: relative; display: inline-block; }
.glitch::before,
.glitch::after {
  content: attr(data-text);
  content: attr(data-text) / ""; /* Alternativtext leer: Screenreader lesen die Kopien nicht */
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  opacity: 0;
  pointer-events: none;
  -webkit-text-stroke: 0;
}
.hero__name:hover .glitch::before,
.glitch-host:hover .glitch::before { color: var(--volt);  animation: glitch-a .24s steps(3) 1 forwards; }
.hero__name:hover .glitch::after,
.glitch-host:hover .glitch::after  { color: var(--amber); animation: glitch-b .24s steps(3) 1 forwards; }

.hero__role {
  display: flex;
  align-items: center;
  margin-top: clamp(22px, 3vh, 34px);
  font-family: var(--font-mono);
  font-size: clamp(13px, 1.3vw, 15px);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg);
  min-height: 1.6em;
}
.hero__prompt { color: var(--volt); margin-right: 10px; }
.hero__tagline {
  max-width: 520px;
  margin-top: 18px;
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.65;
  color: var(--muted);
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(26px, 4vh, 40px);
}
.hero__visual {
  position: relative;
  display: grid;
  place-items: start center;
  padding: 10px 0 40px;
}
.hero__foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 24px;
  width: 100%;
  max-width: var(--max-w);
  margin: clamp(24px, 4vh, 48px) auto 0;
  color: var(--muted-2);
}
/* Erste Sektion rückt näher an den Hero */
.hero + .section { padding-top: clamp(24px, 4vh, 56px); }
.hero__scroll {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--muted);
}
.hero__scroll-arrow {
  display: inline-block;
  color: var(--volt);
  animation: scroll-bounce 1.8s ease-in-out infinite;
}

/* ---------- 3D-Bühne: Foto-Karte, schwebende Labels, Würfel, Drahtgitter ---------- */
.stage {
  --rx: 0deg;          /* Drehung um Y (Maus horizontal) */
  --ry: 0deg;          /* Drehung um X (Maus vertikal) */
  --mx: 50%;           /* Glanzpunkt auf der Karte */
  --my: 50%;
  position: relative;
  width: clamp(250px, 30vw, 380px);
  perspective: 1200px;
}
.wire3d {
  position: absolute;
  left: 50%; top: 50%;
  width: 190%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: .9;
}
.stage__tilt {
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(var(--ry)) rotateY(var(--rx));
  transition: transform .12s linear;
}

/* Foto-Karte */
.pcard {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 22px;
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid rgba(232, 236, 239, .18);
  box-shadow: 0 50px 90px -30px rgba(0, 0, 0, .9), 0 0 70px rgba(var(--volt-rgb), .08);
  transform: translateZ(0);
}
.pcard__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  filter: saturate(.85) contrast(1.05);
}
.pcard__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(5, 6, 7, .9));
  pointer-events: none;
}
.pcard__scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .04) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
  opacity: .7;
  pointer-events: none;
}
.pcard__sweep {
  position: absolute;
  left: 0; right: 0;
  height: 22%;
  top: -25%;
  background: linear-gradient(180deg, transparent, rgba(var(--volt-rgb), .16), transparent);
  animation: sweep 7s ease-in-out infinite;
  pointer-events: none;
}
/* Glanzkante folgt der Maus (Lichtbogen am Rahmen) */
.pcard__glow {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1.5px;
  background: radial-gradient(240px circle at var(--mx) var(--my), rgba(var(--volt-rgb), .95), rgba(var(--volt-rgb), .2) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}
/* HUD-Rahmen: Eckklammern wie ein Zielsucher */
.pcard__hud {
  --c: rgba(var(--volt-rgb), .85);
  --l: 16px;
  position: absolute;
  inset: 10px;
  pointer-events: none;
  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;
}
.pcard__id {
  position: absolute;
  right: 16px; top: 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(var(--volt-rgb), .9);
  text-shadow: 0 0 8px rgba(var(--volt-rgb), .5);
}
.pcard__meta {
  position: absolute;
  left: 16px; bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg);
}

/* CSS-3D-Würfel (Drahtgitter) */
.cube {
  position: absolute;
  width: var(--s);
  height: var(--s);
  transform-style: preserve-3d;
  animation: cube-spin var(--dur) linear infinite;
  pointer-events: none;
}
.cube--1 { --s: 54px; --dur: 16s; --z: 95px;  left: -24%; bottom: -5%; }
.cube--2 { --s: 32px; --dur: 22s; --z: -60px; right: -22%; top: -9%; opacity: .7; }
.cube__face {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(var(--volt-rgb), .75);
  background: rgba(var(--volt-rgb), .05);
  box-shadow: inset 0 0 14px rgba(var(--volt-rgb), .14);
}
.cube__face:nth-child(1) { transform: translateZ(calc(var(--s) / 2)); }
.cube__face:nth-child(2) { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.cube__face:nth-child(3) { transform: rotateY(90deg)  translateZ(calc(var(--s) / 2)); }
.cube__face:nth-child(4) { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.cube__face:nth-child(5) { transform: rotateX(90deg)  translateZ(calc(var(--s) / 2)); }
.cube__face:nth-child(6) { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }

/* Ohne Maus: Bühne wiegt sich langsam von selbst */
@media (hover: none) {
  .stage__tilt { animation: stage-idle 10s ease-in-out infinite; }
}

/* ---------- 3D-Objekte in den Sektionen (hinter dem Inhalt) ---------- */
.section { isolation: isolate; }
.wire3d--sec {
  left: auto; top: auto;
  transform: none;
  width: clamp(240px, 30vw, 400px);
  z-index: -1;
  opacity: .75;
}
.wire3d--tr  { right: -3%; top: -40px; }
.wire3d--bl  { left: -5%; bottom: -30px; }
.wire3d--br  { right: -2%; bottom: 30px; }
.wire3d--mr  { right: -4%; top: 14%; width: clamp(240px, 26vw, 360px); }
.wire3d--big { width: clamp(300px, 38vw, 520px); }
.wire3d--pr  { right: 10%; bottom: -10px; }
/* Kugel im Textfluss unter der Lead-Überschrift von "Über mich" */
.wire3d--inline {
  position: relative;
  left: auto; top: auto;
  transform: none;
  display: block;
  width: clamp(220px, 24vw, 320px);
  margin: 10px auto 0;
  opacity: .8;
}
/* Würfel oben rechts neben dem Einleitungstext der Hobbys */
.cube--h1 { --s: 56px; --dur: 18s; --z: 0px; right: 8%; top: 8px; }
@media (max-width: 900px) {
  .wire3d--sec { width: clamp(180px, 46vw, 260px); opacity: .55; }
  .wire3d--big { width: clamp(220px, 56vw, 320px); }
  .wire3d--inline { display: none; }
  .cube--h1 { --s: 34px; right: 4%; top: -10px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { padding-top: calc(var(--nav-h) + 28px); }
  .hero__inner { grid-template-columns: 1fr; gap: 20px; }
  .hero__visual { padding: 30px 0 10px; }
  .stage { width: min(66vw, 300px); }
  .wire3d { width: 175%; }
  .cube--1 { --s: 40px; left: -16%; }
  .cube--2 { --s: 26px; right: -14%; }
  .hero__matrix {
    opacity: .4;
    -webkit-mask-image: radial-gradient(90% 70% at 50% 70%, #000 0%, rgba(0, 0, 0, .4) 50%, transparent 85%);
    mask-image: radial-gradient(90% 70% at 50% 70%, #000 0%, rgba(0, 0, 0, .4) 50%, transparent 85%);
  }
}
@media (max-width: 640px) {
  .hero__name { font-size: clamp(56px, 17vw, 84px); line-height: .9; }
  .hero__foot { margin-top: 36px; }
}
@media (max-width: 400px) {
  .hero__cta .btn { width: 100%; justify-content: center; }
}
