:root{
  --moveSpeed: 4;
  --mixSpeedAbs: 3;
  --changeSpeed: 5;
  --lineSpeed: 17;
  --colorChange: 1;

  --bg: #000;
  --glassBorder: rgba(255,255,255,0.10);
  --glassFill: rgba(255,255,255,0.06); /* panels */
  --frameFill: rgba(255,255,255,0.15); /* settings windows */
  --frameText: #000;
  --accentRed: #ff2b2b;
  --tooltipBg: #FFC83D; /* orange-yellow */
  --tooltipText: #000;
  --stackW: 750px;
  --stackH: 850px;
  --pageH: 1080px;
}

/* base */
html, body{
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: #eaeaea;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
body{
  min-width: 1700px; /* ab ca. 1700px beginnt horizontales Scrollen */
  overflow-x: auto;
  overflow-y: auto;
}
.stage{
  position: relative;
  width: 100%;
  height: var(--pageH);
  min-height: var(--pageH);
  overflow: hidden;
}

/* background animation (3-layer, intensity + speed scaled via CSS vars) */
.bg{
  position: absolute;
  inset: 0;
  background: #000;
  z-index: 0;
}
.bgLayer{
  position:absolute;
  inset:-10%;
  opacity: calc(var(--bgIntensity, 1) * 1.0);
  filter: none;
  will-change: transform, opacity, filter;
}
/* layer visuals */
.bgLayer.l1{
  background:
    radial-gradient(farthest-side at 30% 30%, rgba(0,140,255,0.55), transparent 55%),
    radial-gradient(farthest-side at 70% 55%, rgba(0,60,170,0.55), transparent 60%),
    radial-gradient(farthest-side at 45% 80%, rgba(0,0,0,1), transparent 65%);
}
.bgLayer.l2{
  background:
    radial-gradient(farthest-side at 60% 25%, rgba(0,110,255,0.45), transparent 58%),
    radial-gradient(farthest-side at 25% 70%, rgba(0,40,120,0.55), transparent 62%);
  mix-blend-mode: screen;
  opacity: calc(var(--bgIntensity, 1) * 0.9);
}
.bgLayer.l3{
  background:
    radial-gradient(farthest-side at 55% 55%, rgba(0,0,0,0.0), rgba(0,0,0,1) 70%);
  opacity: 1;
  filter: none;
}

/* motion */
@keyframes drift1 {
  0%{transform: translate3d(-6%, -3%, 0) scale(1.02) rotate(0deg)}
  50%{transform: translate3d(6%, 4%, 0) scale(1.06) rotate(3deg)}
  100%{transform: translate3d(-6%, -3%, 0) scale(1.02) rotate(0deg)}
} 50%{transform: translate3d(3%, 2%, 0) scale(1.08) rotate(4deg)} 100%{transform: translate3d(-2%, -1%, 0) scale(1.03) rotate(0deg)} }
@keyframes drift2 {
  0%{transform: translate3d(5%, 3%, 0) scale(1.01) rotate(0deg)}
  50%{transform: translate3d(-5%, -4%, 0) scale(1.05) rotate(-3deg)}
  100%{transform: translate3d(5%, 3%, 0) scale(1.01) rotate(0deg)}
} 50%{transform: translate3d(-3%, -2%, 0) scale(1.06) rotate(-4deg)} 100%{transform: translate3d(2%, 1%, 0) scale(1.02) rotate(0deg)} }
@keyframes drift3 {
  0%{transform: scale(1.0)}
  50%{transform: scale(1.01)}
  100%{transform: scale(1.0)}
} 50%{transform: scale(1.02)} 100%{transform: scale(1.0)} }

.bg.anim .l1{ animation: drift1 18s ease-in-out infinite; }
.bg.anim .l2{ animation: drift2 22s ease-in-out infinite; }
.bg.anim .l3{ animation: drift3 10s ease-in-out infinite; }

/* main layout */
.ui{
  position: relative;
  z-index: 2;
  height: var(--pageH);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
}
/* keep some breathing room */
.uiInner{
  grid-column: 2;
  width: 1920px;
  height: var(--pageH);
  position: relative;
  margin: 0 auto;
}

/* logo */
.logo{
  position:absolute;
  top: 24px;
  right: 40px;
  width: 145px;
  height: 95px;
  opacity: 0.20;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

/* settings block (left of stacks) */
.settingsBlock{
  z-index: 6;
  position:absolute;
  top: 150px;
  left: 150px;
  width: 50px;
  height: 185px;
  display:flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.langSwitch{
  display:flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  color: #eaeaea;
  font-size: 14px;
}
.langSwitch label{
  display:flex;
  gap: 8px;
  align-items:center;
  cursor:pointer;
  user-select:none;
}
.langSwitch input{ accent-color: #ffffff; }
.settingsIconWrap{
  position: relative;
  width: 31px;
  height: 25px;
  margin-top: 6px;
}
.settingsIcon{
  width: 31px;
  height: 25px;
  display:block;
  user-select:none;
  -webkit-user-drag:none;
  cursor: grab;
}
.settingsIcon:active{ cursor: grabbing; }

/* tooltip */
.tooltip{
  z-index: 999;
  position:absolute;
  left: 38px;
  top: -8px;
  width: 280px;
  background: var(--tooltipBg);
  color: var(--tooltipText);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.25;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  border: 1px solid rgba(0,0,0,0.12);
  display:none;
}
.tooltip.visible{ display:block; }

/* stacks container */
.stacks{
  z-index: 3;
  position:absolute;
  top: 150px;
  left: 260px;
  display:flex;
  gap: 110px;
}
.stack{
  --textScale: 1;

  width: var(--stackW);
  height: var(--stackH);
  border-radius: 22px;
  border: 1px solid var(--glassBorder);
  background: rgba(255,255,255,0.10);
overflow: hidden;
  position: relative;
}

/* Image header in left stack */
.stackHeader{
  position: relative;
  height: 312px; /* 750 x 312 approx for 1500x625 displayed at 750w */
  border-radius: 22px 22px 0 0;
  overflow:hidden;
}
.stackHeader img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display:block;
}
.ucBar{
  position:absolute;
  left:0;
  right:0;
  top:0;
  height: 64px;
  background: rgba(0,0,0,0.60);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 0 18px;
}
.ucText{
  color: var(--accentRed);
  font-weight: 800;
  letter-spacing: 0.5px;
  font-size: 40px;
  line-height: 1;
  text-transform: uppercase;
  text-align: center;
  width: 100%;
}

/* stack content */
.stackContent{
  height: calc(var(--stackH) - 312px);
  overflow-y: auto;
  padding: 18px 22px 18px;
  font-size: calc(18px * var(--textScale));
  line-height: calc(21px * var(--textScale));
  box-sizing: border-box;
  scrollbar-gutter: stable;
}
.stackRight .stackContent{
  height: var(--stackH);
  padding-top: 26px;
  font-size: calc(18px * var(--textScale));
  line-height: calc(21px * var(--textScale));
}

/* typography */
.p{
  margin: 0 0 14px 0;
  font-size: inherit;
  line-height: inherit;
  color: #ffffff;
}
.p strong{ font-weight: 700; }
.smallNote{
  font-size: 14px;
  opacity: 0.75;
}
.contact{
  margin-top: 10px;
  font-weight: 600;
}

.stack[data-scale="1.1"] .stackContent{ font-size: 19.8px; line-height: 23.1px; }
.stack[data-scale="1.2"] .stackContent{ font-size: 21.6px; line-height: 25.2px; }

/* settings panels (floating) */
.panels{
  position:absolute;
  inset:0;
  pointer-events:none;
}
.panel{
  pointer-events:auto;
  position:absolute;
  min-width: 320px;
  max-width: 420px;
  background: rgba(255,255,255,0.15);
  color: var(--frameText);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 16px;
  padding: 12px 12px 10px;
box-shadow: 0 18px 60px rgba(0,0,0,0.35);
}
.panelHeader{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.panelTitle{
  font-weight: 800;
  font-size: 14px;
}
.panelClose{
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.15);
  background: rgba(255,255,255,0.35);
  color:#000;
  cursor:pointer;
  font-size: 18px;
  line-height: 1;
}
.panelClose:hover{ background: rgba(255,255,255,0.55); }

/* control groups */
.group{
  margin: 10px 0 8px;
}
.groupLabel{
  font-size: 12px;
  font-weight: 700;
  opacity: 0.9;
  margin-bottom: 6px;
}
.btnRow{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
}
.btn{
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.18);
  background: rgba(255,255,255,0.50);
  color:#000;
  cursor:pointer;
  font-weight: 700;
  font-size: 12px;
}
.btn.active{
  background: rgba(0,0,0,0.85);
  color: #fff;
  border-color: rgba(0,0,0,0.85);
}
.toggleRow{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
}
.toggleRow label{
  font-weight: 700;
  font-size: 12px;
}
.toggleRow input{ transform: scale(1.1); }

/* footer note */
.footerNote{
  position:absolute;
  right: 70px;
  bottom: 42px;
  font-size: 13px;
  opacity: 0.70;
}

/* drop affordances (debug only, can be removed) */
.dropzone{
  position:absolute;
  inset:0;
}

/* contact links */
.contactLinks{
  margin-top: 10px;
  display:flex;
  flex-direction: column;
  gap: 6px;
}
.contactLinks a{
  color: var(--accentRed);
  text-decoration: none;
  font-weight: 700;
}
.contactLinks a:hover{ text-decoration: underline; }

.settingsIconWrap:hover .tooltip{ display:block; }

@keyframes hueShift { 0%{filter: blur(40px) saturate(1.05) hue-rotate(0deg);} 50%{filter: blur(40px) saturate(1.05) hue-rotate(18deg);} 100%{filter: blur(40px) saturate(1.05) hue-rotate(0deg);} }
.bg.anim.colorChange .l1{ animation-name: drift1, hueShift; animation-duration: calc((48s / (var(--moveSpeed) * var(--bgSpeed, 1)))), calc((80s / (var(--changeSpeed) * var(--bgSpeed,1)))); animation-timing-function: ease-in-out, ease-in-out; animation-iteration-count: infinite, infinite; }
