:root {
  --bg: #05060a;
  --bg-elevated: #101222;
  --bg-panel: #111320;
  --bg-panel-soft: #0b0d18;
  --accent: #3ae4ff;
  --accent-soft: rgba(58, 228, 255, 0.25);
  --accent-strong: rgba(58, 228, 255, 0.9);
  --text: #f5f6fb;
  --muted: #c2c7dd;
  --muted-soft: #9ca1ba;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --error: #ff4b6e;
  --error-soft: rgba(255, 75, 110, 0.2);
  --instagram: #e4405f;
  --instagram-hover: #d7355a;
  --focus-ring: 0 0 0 2px rgba(58, 228, 255, 0.7);
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.mt-sm {
  margin-top: 0.5rem;
}
.mt-md {
  margin-top: 1rem;
}
.mb-sm {
  margin-bottom: 0.5rem;
}
.mb-md {
  margin-bottom: 1rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

/* Body als Flex-Container für Sticky-Footer */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  background-color: #05060a;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Hauptinhalt füllt den verfügbaren Platz */
main {
  flex: 1 0 auto;
  min-height: 0;
}

/* Footer bleibt unterhalb des Inhalts, aber am Ende der Seite */
.footer {
  flex-shrink: 0;
  margin-top: 3.5rem;
  padding: 2rem 1.2rem calc(2rem + env(safe-area-inset-bottom));
  text-align: center;
  background: transparent;
}

body::before {
  content: "";
  position: fixed;
  inset: -10%;
  z-index: -2;
  background: radial-gradient(circle at 20% 0%, rgba(58, 228, 255, 0.16), transparent 55%),
    radial-gradient(circle at 80% 100%, rgba(148, 87, 255, 0.14), transparent 55%),
    linear-gradient(to bottom, #05060a 50%, #020309 100%);
  opacity: 0.6;
  animation: vjPulse 40s ease-in-out infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.01) 0px,
      rgba(255, 255, 255, 0.01) 1px,
      transparent 1px,
      transparent 3px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.012) 0px,
      rgba(255, 255, 255, 0.012) 1px,
      transparent 1px,
      transparent 4px
    );
  mix-blend-mode: soft-light;
  opacity: 0.08;
  animation: vjNoise 3.5s steps(3, end) infinite;
}

@keyframes vjPulse {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0px) saturate(120%);
  }
  50% {
    transform: translate3d(-1.5%, 1.5%, 0) scale(1.02);
    filter: blur(1px) saturate(130%);
  }
  100% {
    transform: translate3d(1.5%, -1.5%, 0) scale(1.03);
    filter: blur(1.2px) saturate(125%);
  }
}

@keyframes vjNoise {
  0% {
    opacity: 0.07;
    transform: translate3d(0, 0, 0);
  }
  50% {
    opacity: 0.1;
    transform: translate3d(-1px, 1px, 0);
  }
  100% {
    opacity: 0.07;
    transform: translate3d(1px, -1px, 0);
  }
}

h1,
h2 {
  margin: 0 0 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

h1 {
  font-size: 1.8rem;
}

h2 {
  font-size: 1.25rem;
}

p {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.section-title {
  margin: 0.4rem 0 0.2rem;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-soft);
  padding: 0.12rem 0.6rem;
  display: none;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  background: rgba(8, 10, 20, 0.9);
  border: 1px solid var(--border-subtle);
}

/* Ab Desktop: Überschriften anzeigen */
@media (min-width: 769px) {
  .section-title {
    display: inline-flex;
  }
}

.section-title + .panel {
  margin-top: 0.6rem;
}

.layout {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.2rem calc(2rem + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: auto;
  gap: 3.2rem;
}

.hero {
  position: relative;
  max-width: 900px;
  margin: 0 auto 2rem;
  margin-top: 1rem;
  padding: calc(1rem + env(safe-area-inset-top)) 1.75rem 1.75rem;
  border-radius: 20px;
  background: radial-gradient(circle at top left, rgba(58, 228, 255, 0.22), transparent 60%),
    radial-gradient(circle at top right, rgba(148, 87, 255, 0.28), transparent 60%),
    linear-gradient(135deg, rgba(8, 10, 22, 0.72), rgba(5, 6, 14, 0.82));
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 22px 55px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 10% 0%, rgba(58, 228, 255, 0.22), transparent 60%),
    radial-gradient(circle at 90% 20%, rgba(248, 149, 255, 0.2), transparent 65%);
  opacity: 0.6;
  pointer-events: none;
  filter: blur(4px);
}

.hero::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.09) 40%, transparent 60%);
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  animation: heroSweep 14s ease-in-out infinite;
}

@keyframes heroSweep {
  0%,
  25% {
    transform: translateX(-30%);
    opacity: 0;
  }
  35%,
  55% {
    transform: translateX(20%);
    opacity: 0.6;
  }
  70%,
  100% {
    transform: translateX(60%);
    opacity: 0;
  }
}

.hero-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.75rem;
  z-index: 1;
}

.hero-brand {
  flex: 1.2;
  min-width: 0;
}

.hero-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.9rem;
}

.logo {
  width: 705px;
  max-width: 100%;
  height: auto;
  display: block;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  margin-bottom: 0.5rem;
  animation: logoGlow 10s ease-in-out infinite;
}

@keyframes logoGlow {
  0%,
  100% {
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.9)) brightness(1);
    transform: translateY(0);
  }
  50% {
    filter: drop-shadow(0 10px 26px rgba(0, 0, 0, 1)) brightness(1.08);
    transform: translateY(-1px);
  }
}

.hero-tagline {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.hero-subtext {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted-soft);
  line-height: 1.55;
  max-width: 32rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.instagram-link {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  color: #ffffff !important;
  text-decoration: none;
  background: radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.18), transparent 60%),
    linear-gradient(135deg, #e4405f, #f77737, #e4405f);
  background-size: 220% 220%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow:
    0 12px 30px rgba(228, 64, 95, 0.5),
    0 0 0 1px rgba(0, 0, 0, 0.8);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition:
    background-position 0.35s ease,
    box-shadow 0.25s ease,
    transform 0.14s ease,
    border-color 0.2s ease,
    opacity 0.16s ease;
  backdrop-filter: blur(14px);
}

.instagram-link:hover {
  transform: translateY(-1px) scale(1.02);
  background-position: 100% 0;
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow:
    0 20px 48px rgba(228, 64, 95, 0.75),
    0 0 0 1px rgba(0, 0, 0, 0.8);
}

.instagram-link:active {
  transform: translateY(0) scale(0.99);
  box-shadow:
    0 10px 24px rgba(228, 64, 95, 0.5),
    0 0 0 1px rgba(0, 0, 0, 0.8);
}

.instagram-link:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.9),
    0 0 0 4px rgba(58, 228, 255, 0.9),
    0 18px 40px rgba(228, 64, 95, 0.65);
}

.instagram-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.instagram-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.08rem;
  text-align: left;
}

.instagram-label-top {
  font-size: 0.78rem;
}

.instagram-label-bottom {
  font-size: 0.65rem;
  text-transform: none;
  letter-spacing: 0.03em;
  opacity: 0.95;
}

#about-masel {
  max-width: 900px;
  margin: 0 auto 1.8rem;
  padding: 1.8rem 1.7rem;
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  background: var(--bg-panel-soft);
}

.panel {
  width: 100%;
  margin: 0;
  background: linear-gradient(135deg, rgba(18, 22, 46, 0.82), rgba(9, 11, 24, 0.9));
  border-radius: 16px;
  padding: 1.8rem 1.7rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(58, 228, 255, 0.12), transparent 55%);
  opacity: 0.7;
  pointer-events: none;
}

.panel::after {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 1px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 70%);
  opacity: 0.6;
  pointer-events: none;
}

.panel--highlight {
  border-color: var(--accent-soft);
  box-shadow:
    0 0 0 1px rgba(58, 228, 255, 0.18),
    0 22px 55px rgba(0, 0, 0, 0.75);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

/* ✅ FIX: App-Grid standardmäßig (Desktop) ausblenden */
.app-grid {
  display: none;
}

/* ✅ FIX: Flip (Homescreen) standardmäßig (Desktop/Tablet) ausblenden */
.page-flip {
  display: none;
}

/* Desktop / Tablet Tools-Navigation */
.tools-nav {
  max-width: 900px;
  margin: 1rem auto 2rem;
  padding: 0.4rem 0.5rem;
  border-radius: 999px;
  background: radial-gradient(circle at 0 0, rgba(58, 228, 255, 0.18), rgba(5, 7, 16, 0.98));
  border: 1px solid rgba(58, 228, 255, 0.4);
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: center;
  font-size: 0.8rem;
  box-sizing: border-box;
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(0, 0, 0, 0.95);
}

.pill-nav {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.32rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted-soft);
  background: linear-gradient(135deg, rgba(15, 18, 34, 0.95), rgba(7, 9, 20, 1));
  text-decoration: none;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.85);
  transition:
    background 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.08s ease,
    border-color 0.16s ease,
    opacity 0.16s ease;
  white-space: nowrap;
  cursor: pointer;
}

.pill-nav::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.16), transparent 60%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

.pill-nav:hover {
  border-color: rgba(58, 228, 255, 0.9);
  color: var(--text);
  background: linear-gradient(135deg, rgba(30, 40, 78, 1), rgba(10, 15, 32, 1));
  box-shadow:
    0 0 16px rgba(58, 228, 255, 0.9),
    0 0 0 1px rgba(0, 0, 0, 1);
  transform: translateY(-1px);
}

.pill-nav:hover::before {
  opacity: 1;
}

.pill-nav:active {
  transform: translateY(0);
  box-shadow:
    0 0 10px rgba(58, 228, 255, 0.6),
    0 0 0 1px rgba(0, 0, 0, 1);
}

.pill-nav:focus-visible {
  outline: none;
  border-color: rgba(58, 228, 255, 1);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 1),
    0 0 0 2px rgba(58, 228, 255, 1);
  color: var(--text);
}

.pill-nav.is-active {
  border-color: rgba(58, 228, 255, 1);
  color: #020309;
  background: radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.4), rgba(58, 228, 255, 1));
  box-shadow:
    0 0 20px rgba(58, 228, 255, 0.95),
    0 0 0 1px rgba(0, 0, 0, 1);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.45rem 0 1rem;
}

.pill {
  font-size: 0.72rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  background: rgba(8, 10, 20, 0.9);
}

.pill strong {
  color: var(--accent);
}

.tool-usecase {
  font-size: 0.9rem;
  color: var(--muted-soft);
  margin: 0.15rem 0 0.5rem;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-row {
  margin-bottom: 0.95rem;
}

label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.8rem;
  color: var(--muted-soft);
  margin-bottom: 0.2rem;
}

label .primary {
  color: var(--text);
  font-weight: 500;
  font-size: 0.86rem;
  flex: 1;
}

label .unit {
  font-size: 0.78rem;
  opacity: 0.8;
  min-width: 70px;
  text-align: right;
}

input[type="number"],
input[type="text"],
select {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border-radius: 9px;
  border: 1px solid rgba(58, 228, 255, 0.25);
  background: radial-gradient(circle at top, rgba(58, 228, 255, 0.12), rgba(8, 9, 18, 0.96));
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  appearance: textfield;
  font-variant-numeric: tabular-nums;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease,
    transform 0.06s ease;
}

input[type="number"]:hover,
input[type="text"]:hover,
select:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: radial-gradient(circle at top, rgba(58, 228, 255, 0.18), rgba(11, 13, 24, 0.98));
}

input[type="number"]:focus-visible,
input[type="text"]:focus-visible,
select:focus-visible {
  border-color: rgba(58, 228, 255, 0.9);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 1),
    0 0 16px rgba(58, 228, 255, 0.8);
  background: rgba(11, 14, 26, 1);
  transform: translateY(-1px);
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.keystone-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.4rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: rgba(8, 10, 20, 0.6);
  border: 1px solid var(--border-subtle);
}

.keystone-form {
  display: flex;
  flex-direction: column;
}

.keystone-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
}

.keystone-image {
  width: 100%;
  max-width: 220px;
  border-radius: 6px;
}

.keystone-legend {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.8rem;
  color: var(--muted-soft);
}

.keystone-legend strong {
  color: var(--accent);
}

.keystone-legend span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.keystone-color-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: #f6724e;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.button-row {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.3rem;
}

button {
  cursor: pointer;
  border-radius: 999px;
  border: 0;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition:
    background 0.16s ease,
    transform 0.08s ease,
    box-shadow 0.2s ease,
    opacity 0.16s ease;
  position: relative;
}

.inline-link {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: all 0.2s ease;
}

.inline-link:hover {
  color: var(--accent);
  text-shadow: 0 0 8px rgba(58, 228, 255, 0.6);
  text-decoration-thickness: 2px;
}

.btn-primary {
  background: radial-gradient(circle at 0 0, #ffffff 0, #ffffff 12%, transparent 40%),
    linear-gradient(135deg, #3ae4ff, #4af2c5);
  color: #020309;
  box-shadow:
    0 0 18px rgba(58, 228, 255, 0.7),
    0 0 32px rgba(58, 228, 255, 0.4);

  /* verhindert Double-Tap-Zoom auf vielen Mobile-Browsern */
  touch-action: manipulation;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 22px rgba(58, 228, 255, 0.9),
    0 0 40px rgba(58, 228, 255, 0.6);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow:
    0 0 16px rgba(58, 228, 255, 0.7),
    0 0 28px rgba(58, 228, 255, 0.5);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  border: 1px solid var(--border-subtle);

  /* verhindert Double-Tap-Zoom auf vielen Mobile-Browsern */
  touch-action: manipulation;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.result-box {
  margin-top: 0.7rem;
  padding: 0.6rem 0.75rem;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(10, 12, 22, 0.96), rgba(6, 7, 15, 0.98));
  border: 1px dashed rgba(255, 255, 255, 0.16);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
}

.result-line {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.result-line .label {
  opacity: 0.85;
}

.result-line .value {
  color: var(--text);
  font-weight: 500;
}

.result-line--highlight .value {
  font-size: 0.95rem;
  color: var(--accent-strong);
}

.hint {
  font-size: 0.8rem;
  color: var(--muted-soft);
  margin-top: 0.35rem;
}

.error {
  color: var(--error);
  font-size: 0.8rem;
  margin-top: 1rem;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  background: var(--error-soft);
  border: 1px solid rgba(255, 75, 110, 0.5);
}

.panel--dmx h2 {
  margin-bottom: 0.5rem;
}

.dmx-log {
  margin-top: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  background: rgba(5, 7, 14, 0.9);
  border: 1px solid var(--border-subtle);
  max-height: 160px;
  overflow-y: auto;
}

.dmx-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted-soft);
  margin-bottom: 0.35rem;
}

.dmx-log-actions {
  display: flex;
  gap: 0.3rem;
}

.dmx-log-copy,
.dmx-log-clear {
  border-radius: 999px;
  border: 0;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.dmx-log-copy {
  background: rgba(58, 228, 255, 0.08);
  color: var(--accent);
}

.dmx-log-copy:hover {
  background: rgba(58, 228, 255, 0.16);
  color: #fff;
}

.dmx-log-clear {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.dmx-log-clear:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.dmx-log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.dmx-log-list li + li {
  margin-top: 0.15rem;
}

.dmx-universe {
  margin-top: 1rem;
}

.dmx-universe-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.8rem;
  color: var(--muted-soft);
  margin-bottom: 0.35rem;
}

.dmx-usage-label {
  font-weight: 500;
  color: var(--accent);
}

.dmx-universe-bar {
  width: 100%;
  border-radius: 6px;
  background: radial-gradient(circle at 0 0, rgba(58, 228, 255, 0.2), rgba(8, 10, 20, 0.95));
  border: 1px solid var(--border-subtle);
  padding: 4px 6px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.9),
    0 0 24px rgba(58, 228, 255, 0.25);
}

.dmx-universe-grid {
  position: relative;
  height: 16px;
  display: grid;
  grid-template-columns: repeat(512, 1fr);
  gap: 0;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 8px 100%;
}

.dmx-block {
  background: linear-gradient(90deg, #3ae4ff, #4af2c5);
  border-radius: 3px;
  box-shadow:
    0 0 10px rgba(58, 228, 255, 0.9),
    0 0 24px rgba(74, 242, 197, 0.7);
}

.key-traffic-light {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.4rem;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6);
}

.key-traffic-light--green {
  background: #39d98a;
}

.key-traffic-light--yellow {
  background: #f6c453;
}

.key-traffic-light--red {
  background: #ff4b6e;
}

.back-to-top {
  position: fixed;
  right: 1.4rem;
  bottom: 1.4rem;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(58, 228, 255, 0.7);
  background: radial-gradient(circle at 30% 0, rgba(255, 255, 255, 0.3), rgba(5, 7, 16, 0.98));
  color: var(--accent);
  font-size: 1.3rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.9),
    0 0 16px rgba(58, 228, 255, 0.6);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
  z-index: 50;
}

.back-to-top:hover {
  background: radial-gradient(circle at 30% 0, rgba(255, 255, 255, 0.45), rgba(8, 10, 22, 1));
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 1),
    0 0 22px rgba(58, 228, 255, 0.9);
}

.back-to-top:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 1),
    0 0 0 2px rgba(58, 228, 255, 1),
    0 0 22px rgba(58, 228, 255, 0.9);
}

.back-to-top--visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Touch Target Mindesthöhe */
button,
.instagram-link,
input:focus-visible,
select:focus-visible {
  min-height: 44px;
}

.footer-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--muted-soft);
}

.footer-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition:
    color 0.2s ease,
    text-decoration-color 0.2s ease;
}

.footer-link:hover {
  color: #4af2c5;
  text-decoration: underline;
}

/* ---------- Responsive + Mobile Flip ---------- */

@media (max-width: 900px) {
  .hero {
    padding: calc(0.8rem + env(safe-area-inset-top)) 1.2rem 1.6rem;
    margin-bottom: 1.75rem;
  }

  .layout {
    grid-template-columns: 1fr;
    gap: 2.4rem;
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }

  .panel {
    padding: 1.5rem 1.35rem;
  }

  #about-masel {
    padding: 1.5rem 1.35rem;
  }

  .hero-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.3rem;
  }

  .hero-meta {
    width: 100%;
  }
}

@media (max-width: 700px) {
  .grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  h1 {
    font-size: 1.55rem;
  }

  h2 {
    font-size: 1.15rem;
  }

  .form-row input,
  .form-row select {
    font-size: 1rem;
    padding: 0.75rem 0.65rem;
  }

  .keystone-layout {
    grid-template-columns: 1fr;
  }

  .keystone-image {
    max-width: 260px;
  }
}

/* Mobile Flip-only Styles */
@media (max-width: 768px) {
  /* Tools-Nav mobil ausblenden, Flip benutzen */
  .tools-nav {
    display: none;
  }

  .layout {
    padding-top: 0;
  }

  /* Panels im Hauptlayout mobil ausblenden */
  #toolsRoot .panel {
    display: none;
  }

  /* Flip-Container als Karte */
  .page-flip {
    display: block;
    position: relative;
    max-width: 900px;
    margin: 0 auto 1.5rem;
    width: 100%;
    box-sizing: border-box;
    perspective: 1600px;
  }

  /* Karte (Flipper) */
  .page-flip-inner {
    position: relative;
    width: 100%;
    transform-style: preserve-3d;
    transition: transform 0.65s cubic-bezier(0.22, 0.61, 0.36, 1);
  }

  .page-flip-inner.is-flipped {
    transform: rotateY(180deg);
  }

  .page-face {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 1.4rem 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    min-height: 0;
  }

  /* Sichtbarkeit/Klicks sauber steuern */
  .page-front {
    pointer-events: auto;
    z-index: 2;
    transform: rotateY(0deg);
  }
  .page-back {
    pointer-events: none;
    z-index: 1;
    transform: rotateY(180deg);
  }

  .page-flip-inner.is-flipped .page-front {
    pointer-events: none;
  }
  .page-flip-inner.is-flipped .page-back {
    pointer-events: auto;
  }

  .page-back {
    background: radial-gradient(circle at top left, rgba(58, 228, 255, 0.18), transparent 60%),
      radial-gradient(circle at bottom right, rgba(148, 87, 255, 0.22), transparent 60%),
      linear-gradient(135deg, rgba(10, 12, 26, 0.98), rgba(4, 5, 12, 0.98));
    border-radius: 18px;
    box-shadow:
      0 22px 55px rgba(0, 0, 0, 0.85),
      0 0 0 1px rgba(0, 0, 0, 0.9);
  }

  .page-header {
    margin-bottom: 1.2rem;
  }

  .page-title {
    font-size: 1.3rem;
    margin: 0 0 0.25rem;
  }

  .page-sub {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted-soft);
  }

  .app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 1.1rem;
    margin-top: 0.8rem;
  }

  .app-icon-button {
    border: 0;
    background: none;
    padding: 0;
    color: inherit;
    cursor: pointer;
    text-align: center;
  }

  .app-icon-shell {
    width: 72px;
    height: 72px;
    margin: 0 auto 0.4rem;
    border-radius: 22px;
    background: radial-gradient(circle at 20% 0%, rgb(124, 100, 161), transparent 55%),
      linear-gradient(135deg, #3ae4ff, #4af2c5);
    box-shadow:
      0 12px 30px rgba(0, 0, 0, 0.85),
      0 0 0 1px rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    transition:
      transform 0.12s ease,
      box-shadow 0.18s ease;
  }

  .app-icon-label {
    font-size: 0.78rem;
    color: var(--muted);
  }

  .app-icon-button:hover .app-icon-shell {
    transform: translateY(-2px);
    box-shadow:
      0 16px 36px rgba(0, 0, 0, 1),
      0 0 0 1px rgba(0, 0, 0, 0.95);
  }

  .app-icon-button:focus-visible .app-icon-shell {
    outline: none;
    box-shadow:
      0 0 0 2px rgba(0, 0, 0, 1),
      0 0 0 4px rgba(58, 228, 255, 1);
  }

  .tool-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center; /* Titel in die Mitte */
    gap: 0.7rem;
    min-height: 44px; /* match Touch-Target */
    margin-bottom: 0.9rem;
  }

  .tool-back-btn {
    position: absolute;
    right: 0;
    top: 0%;                 /* wichtig, damit translateY(-50%) korrekt zentriert */
    display: inline-flex;
    align-items: center;
    line-height: 1;
    transform: translateY(-50%);
    white-space: nowrap;

    border-radius: 999px;
    border: 1px solid rgba(58, 228, 255, 0.45);
    background: rgba(58, 228, 255, 0.18);
    color: var(--text);
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
    cursor: pointer;

    box-shadow:
      0 0 0 1px rgba(0,0,0,1),
      0 0 0 2px rgba(58,228,255,0.75),
      0 0 18px rgba(58,228,255,0.35);
  }

  .tool-back-btn:hover {
    background: rgba(58, 228, 255, 0.24);
    box-shadow:
      0 0 0 1px rgba(0,0,0,1),
      0 0 0 2px rgba(58,228,255,0.95),
      0 0 22px rgba(58,228,255,0.55);
  }

  /* Fokus-Ring für Keyboard */
  .tool-back-btn:focus-visible {
    outline: none;
    box-shadow:
      0 0 0 1px rgba(0,0,0,1),
      0 0 0 3px rgba(58,228,255,1),
      0 0 26px rgba(58,228,255,0.65);
  }

  .tool-title {
    font-size: 1.05rem;
    font-weight: 600;
    text-align: center;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    /* verhindert Kollision mit dem linken Button (Safety) */
    padding: 0 4.5rem;
    max-width: 100%;
  }

  .tool-view {
    margin-top: 0.3rem;
    padding: 1.2rem 1rem;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(17, 21, 42, 0.96), rgba(6, 8, 18, 0.98));
    border: 1px solid var(--border-subtle);
    box-shadow:
      0 18px 42px rgba(0, 0, 0, 0.9),
      0 0 0 1px rgba(0, 0, 0, 1);
  }

  .tool-panel {
    display: none;
  }

  .tool-panel.is-active {
    display: block;
  }

  .tool-view .panel {
    display: block;
  }

  /* ✅ Mobile: Back-to-top ausblenden */
  .back-to-top {
    display: none !important;
  }
}

@media (max-width: 600px) {
  .hero {
    padding: calc(1rem + env(safe-area-inset-top)) 1rem 1.4rem;
    border-radius: 16px;
  }

  .hero-actions {
    width: 100%;
  }

  .instagram-link {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .instagram-label {
    align-items: center;
  }

  /* ✅ bleibt ebenfalls weg (optional/konsequent) */
  .back-to-top {
    display: none !important;
  }
}

@media (max-width: 500px) {
  .button-row {
    flex-direction: column;
  }

  button {
    padding: 0.85rem 1.25rem;
    font-size: 0.9rem;
  }

  .footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .footer-content {
    flex-direction: column;
    gap: 0.6rem;
  }
}

/* Extra-Abstand zum Footer auf Mobile */
@media (max-width: 768px) {
  main {
    padding-bottom: 6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after,
  .hero::after,
  .logo,
  .page-flip-inner {
    animation: none !important;
    transition: none !important;
  }
  .page-flip-inner.is-flipped {
    transform: rotateY(180deg);
  }
}
