/*
  M.E.S.S. homepage / landing (index.html) – center-wrapper, coord-system, services, CTA, identity-links, canvas, footer-bar.
  Depends on brand.css + components.css.
*/

#center-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 10;
  flex: 1;
  width: 100%;
  max-width: 100vw;
  text-align: center;
  pointer-events: none;
  flex-wrap: nowrap;
  padding-top: clamp(0.5em, 1.2vh, 1.5em);
  font-family: Orbitron, Arial, sans-serif;
}

#services-section {
  position: relative;
  z-index: 20;
  width: 95%;
  max-width: 1200px;
  margin: clamp(1rem, 2.5vh, 2rem) auto 0 auto;
  padding: 1.5em 1.5em;
  color: var(--text);
  pointer-events: none;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 0.95fr));
  gap: 2em;
  width: 100%;
}

#cta-terminal {
  display: flex;
  justify-content: center;
  margin-top: clamp(0.8em, 1.5vh, 1.2em);
  margin-bottom: clamp(0.6em, 1.2vh, 1em);
  position: relative;
  z-index: 1000;
}

#identity-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: clamp(14px, 2vw, 22px);
  margin-top: clamp(1em, 1.5vh, 2em);
  margin-bottom: clamp(1em, 1.5vh, 2em);
  position: relative;
  z-index: 1000;
}

#coord-system {
  /* Ein Wertesatz für alle Viewports – verhindert Sprung bei 700px */
  --coord-y: 27.5%;
  --coord-origin-x: 29.5%;
  --coord-x-top: 86%;
  --coord-origin-y: 96%;
  position: relative;
  width: fit-content;
  min-width: 3em;
  min-height: 3.5em;
  margin: 0 auto 0.4em auto;
  pointer-events: none;
  padding: 0 1.6em;
}

.axis-x, .axis-y {
  position: absolute;
  opacity: 0.8;
  z-index: 1;
  border-radius: 3px;
}

.axis-x {
  left: -2.6em; right: -2.6em;
  top: var(--coord-x-top);
  height: 0.5em;
  background: linear-gradient(90deg, transparent 0 10%, var(--dampf) 20% 50%, transparent 90% 100%);
  opacity: 0.7;
}

.axis-y {
  top: -2.0em; bottom: -2.0em;
  left: var(--coord-y);
  width: 0.5em;
  transform: translateX(-50%);
  background: linear-gradient(transparent 0 13%, var(--dampf) 50% 90%, transparent 98% 100%);
  opacity: 0.7;
}

.origin-zero {
  position: absolute;
  font-family: Orbitron, sans-serif;
  font-weight: 700;
  font-size: 1.2em;
  color: var(--dampf);
  left: var(--coord-origin-x);
  top: var(--coord-origin-y);
  opacity: 0.7;
  user-select: none;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 3;
}

.axis-x.hidden, .axis-y.hidden, .origin-zero.hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.4s;
}

.quad-row {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 0.16em;
  z-index: 2;
}

.quad {
  font-family: Orbitron, sans-serif;
  font-weight: 900;
  font-size: clamp(3em, 16vw, 16em);
  color: #f6ffff;
  text-shadow: 0 0 14px var(--dampf), 0 0 4px var(--dampf), 2px 4px 0 #012, 4px 8px 0 #023, 6px 12px 0 #034;
  user-select: none;
  pointer-events: none;
  letter-spacing: 0.12em;
}

#subtitle {
  font-size: clamp(1.1em, 2.6vw, 3em);
  margin-top: clamp(1.15em, 2vh, 2.25em);
  letter-spacing: 0.09em;
  color: #f6ffff;
  font-weight: 900;
  text-align: center;
  opacity: 0.96;
  z-index: 5;
}

#slogan {
  font-size: clamp(1em, 1.6vw, 1.6em);
  margin-top: clamp(1.15em, 2vh, 2.25em);
  color: var(--dampf);
  letter-spacing: 0.06em;
  opacity: 0.91;
  font-family: inherit;
  text-align: center;
  font-weight: 900;
  z-index: 5;
}

.service-card {
  backdrop-filter: blur(4px);
  border-radius: 1em;
  padding: 1.5em;
  text-align: left;
  cursor: none;
  user-select: none;
  transition: transform 0.3s, box-shadow 0.3s;
  pointer-events: none;
  box-shadow: none;
  border: 1px solid rgba(0, 255, 242, 0.25);
  background: rgba(0, 0, 0, 0.35);
}

.service-card h3 {
  margin-top: 0;
  margin-bottom: 0.5em;
  font-size: clamp(0.75em, 3.5vw, 1.1em);
  color: var(--dampf);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(0, 255, 242, 0.5);
}

.service-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.service-card li {
  font-family: Orbitron, monospace;
  font-size: clamp(0.55em, 2.5vw, 0.9em);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.95);
  padding-left: 1.2em;
  position: relative;
}

.service-card li::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--dampf);
  font-weight: bold;
}

/* Slogan-Buttons: Schriftfarbe = Randfarbe (--dampf bzw. --accent), alles aus brand.css */
#slogan .smart-button {
  display: inline-block;
  padding: 0.13em 0.32em;
  border: 1.6px solid var(--dampf-a70);
  border-radius: 0.3em;
  cursor: none;
  transition: box-shadow 0.22s, border-color 0.22s, background 0.2s, filter 0.18s;
  pointer-events: auto;
  background: var(--dampf-a16);
  box-shadow: 0 0 8px var(--dampf-a13), 0 0 1px color-mix(in srgb, var(--wolke) 13%, transparent);
  color: var(--dampf);
  font-weight: 900;
  margin: 0 0.13em;
}

#slogan .smart-button.toggle-active {
  background: rgba(54, 236, 9, 0.8);
  border-color: rgb(11, 248, 42);
  color: var(--keim);
  box-shadow: 0 0 30px rgba(0, 255, 242, 0.4), 0 0 12px rgba(255, 255, 255, 0.2) inset;
}

#slogan .smart-button.trigger {
  border-color: var(--accent);
  color: var(--wolke);
  background: var(--accent-button-fill);
  background-size: 220% 100%;
  animation: accent-button-shimmer 5s ease-in-out infinite;
  box-shadow:
    0 0 16px var(--accent-a40),
    0 0 28px var(--accent-a16),
    inset 0 1px 0 color-mix(in srgb, var(--accent) 35%, transparent);
}

@keyframes accent-button-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  #slogan .smart-button.trigger {
    animation: none;
    background-size: 100% 100%;
  }
}

#slogan .smart-button.trigger:active {
  background: var(--accent-a32);
  box-shadow: 0 0 24px color-mix(in srgb, var(--wolke) 47%, transparent), 0 0 12px var(--accent-a50);
}

#slogan .smart-button:active,
#slogan .smart-button:focus {
  outline: none;
  filter: brightness(1.25);
}

#slogan .smart-button:hover,
#slogan .smart-button:focus-visible {
  box-shadow:
    0 0 24px var(--dampf-a75),
    0 0 8px color-mix(in srgb, var(--wolke) 47%, transparent),
    0 0 1px color-mix(in srgb, var(--wolke) 13%, transparent);
  filter: brightness(1.35);
  z-index: 1;
}

#slogan .smart-button.trigger:hover,
#slogan .smart-button.trigger:focus-visible {
  box-shadow:
    0 0 32px var(--accent-a75),
    0 0 14px color-mix(in srgb, var(--wolke) 47%, transparent),
    0 0 1px color-mix(in srgb, var(--wolke) 13%, transparent);
  filter: brightness(1.2);
  z-index: 1;
}

.identity-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: clamp(100px, 14vw, 180px);
  padding: clamp(8px, 1vw, 12px) clamp(10px, 1.4vw, 14px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.05) 0 1px, transparent 1px 4px),
    rgba(0, 0, 0, 0.22);
  color: #fff;
  text-decoration: none;
  pointer-events: auto;
}

.identity-label {
  font-family: Orbitron, system-ui, sans-serif;
  font-weight: 900;
  letter-spacing: 0.04em;
  font-size: clamp(0.9rem, 1.2vw, 1.05rem);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.identity-source {
  font: 600 clamp(0.72rem, 0.9vw, 0.85rem)/1.2 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.identity-link:hover {
  border-color: rgba(0, 234, 255, 0.6);
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.06) 0 1px, transparent 1px 4px),
    rgba(0, 234, 255, 0.1);
}

.identity-link:focus { outline: none; }
.identity-link:focus-visible {
  box-shadow: 0 0 0 2px rgba(0, 255, 242, 0.6);
  border-color: rgba(0, 255, 242, 0.8);
}

.identity-link.identity-link--cta {
  width: min(560px, 92vw);
  border-radius: 12px;
  align-items: center;
  text-align: center;
  padding: 14px 18px;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.identity-link--cta .identity-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: normal;
}

.identity-link--cta .identity-source {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-weight: 500;
  opacity: 0.75;
}

.identity-link.identity-link--cta:hover {
  border-color: rgba(0, 255, 242, 0.85);
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.08) 0 1px, transparent 1px 4px),
    rgba(0, 255, 242, 0.14);
  transform: translateY(-2px);
}

#fluidCanvas, #crosshairCanvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100vh;
  display: block;
}

#crosshairCanvas {
  z-index: 1;
  pointer-events: none;
}

#fluidCanvas {
  background: var(--bg) !important;
  z-index: 0;
  pointer-events: auto;
  touch-action: pan-y;
  cursor: none;
}

#canvas-fade {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 2;
  background: var(--bg);
  opacity: 1;
  pointer-events: none;
  transition: opacity 1.6s cubic-bezier(0.66, 0, 0.22, 1);
}
#canvas-fade.fadeout { opacity: 0; }

#canvas-led-cursor {
  position: fixed;
  z-index: 199999;
  width: 36px; height: 36px;
  pointer-events: none;
  left: 0; top: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, var(--dampf) 60%, rgba(0, 216, 255, 0.27) 90%, transparent 100%);
  box-shadow: 0 0 18px 6px rgba(0, 255, 242, 0.4), 0 0 0 3px rgba(0, 255, 242, 0.13);
  opacity: 0.86;
  animation: pulse-cursor 3.2s infinite cubic-bezier(0.4, 0, 0.6, 1);
  transition: opacity 0.14s;
  will-change: transform, opacity;
  display: none;
}

@keyframes pulse-cursor {
  0%, 100% { box-shadow: 0 0 18px 6px rgba(0, 255, 242, 0.4), 0 0 0 3px rgba(0, 255, 242, 0.13); opacity: 0.86; }
  50% { box-shadow: 0 0 28px 14px rgba(0, 255, 242, 0.6), 0 0 0 6px rgba(0, 255, 242, 0.13); opacity: 1; }
}

.cursor { animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

#fps-info {
  position: fixed;
  top: 1.1em; left: 1.5em;
  color: var(--dampf);
  font-family: Orbitron, monospace;
  font-size: 1.2em;
  background: rgba(11, 15, 20, 0.55);
  border-radius: 0.4em;
  padding: 0.2em 0.9em;
  z-index: 88888;
  pointer-events: none;
  letter-spacing: 0.02em;
  text-shadow: 0 0 8px rgba(0, 255, 242, 0.5);
}

.nerd-menu-corner {
  position: fixed;
  left: 0; right: 1em; bottom: 1em;
  z-index: 188888;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}

.nerd-menu-corner > * {
  pointer-events: auto;
}

#nerd-menu-toggle {
  font-size: 1.5em;
  padding: 0.12em 0.6em;
  line-height: 1;
  background: rgba(11, 31, 41, 0.88);
  border: 2.5px solid rgba(0, 255, 242, 0.5);
  border-radius: 0.53em;
  box-shadow: 0 0 8px rgba(0, 255, 242, 0.27);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: none;
  outline: none;
  transition: background 0.18s, box-shadow 0.18s;
}

#nerd-menu-toggle:focus,
#nerd-menu-toggle:hover {
  background: rgba(0, 255, 242, 0.13);
  box-shadow: 0 0 15px rgba(0, 255, 242, 0.75);
}

#nerd-menu-list {
  display: none;
  background: rgba(11, 15, 24, 0.95);
  color: var(--dampf);
  border: 1.4px solid var(--dampf);
  border-radius: 0.6em;
  font-family: Orbitron, monospace;
  font-size: 1.04em;
  margin-top: 0.35em;
  padding: 1em 1.6em;
  min-width: 15em;
  text-align: left;
  box-shadow: 0 2px 16px rgba(0, 255, 242, 0.13);
  letter-spacing: 0.03em;
}

#nerd-menu-list code {
  background: rgba(0, 255, 242, 0.1);
  border-radius: 0.18em;
  padding: 0.05em 0.23em;
  font-size: 1em;
  color: var(--text);
  margin-right: 0.7em;
}

#footer-bar {
  position: relative;
  margin-top: auto;
  width: 100%;
  background: rgba(0, 16, 32, 0.8);
  backdrop-filter: blur(5px);
  color: var(--dampf);
  font-family: Orbitron, Arial, monospace;
  font-size: 1em;
  letter-spacing: 0.01em;
  text-align: center;
  padding: 0.42em 1.2em 0.22em 1.2em;
  box-sizing: border-box;
  z-index: 100002;
  box-shadow: 0 0 22px rgba(0, 255, 242, 0.2);
  pointer-events: auto;
  cursor: none;
}

.footer-link {
  color: var(--dampf);
  text-decoration: none;
  margin: 0 0.7em;
  font-weight: 500;
  opacity: 0.97;
  transition: color 0.16s;
}

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

.footer-sep {
  color: rgba(0, 255, 242, 0.5);
  opacity: 0.77;
  margin: 0 0.18em;
  font-size: 1.08em;
}

.footer-hint {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.95em;
  margin-top: 0.13em;
  letter-spacing: 0.03em;
}

@media (pointer: coarse), (max-width: 650px) {
  .nerd-menu-corner { display: none !important; }
}

/* Schmal/mobile: nur Größen skalieren, Position bleibt prozentbasiert (kein top↔bottom-Wechsel) */
@media (max-width: 700px) {
  #coord-system {
    padding: 0 1em;
  }
  .axis-x {
    left: -1.2em;
    right: -1.2em;
    height: 0.28em;
  }
  .axis-y {
    top: -1.2em;
    bottom: -1.8em;
    width: 0.28em;
  }
  .origin-zero {
    font-size: 0.66em;
  }
  .quad { font-size: clamp(2.5em, 15vw, 6em); }
  #subtitle {
    margin-top: 1em; margin-bottom: 0.5em;
    font-size: clamp(0.5em, 4vw, 1.5em);
    line-height: 1.2;
  }
  #slogan {
    margin-top: 0.5em;
    font-size: clamp(0.6em, 3.5vw, 1.2em);
    line-height: 1.3;
  }
  #center-wrapper {
    min-width: 85vw;
    max-width: 98vw;
    top: auto;
    transform: none;
    padding-top: 0.2em;
    margin-bottom: 2em;
  }
  .footer-hint { font-size: 0.8em; margin-top: 0.2em; }
  .footer-link { font-size: 0.9em; margin: 0 0.5em; }
  .footer-sep { font-size: 0.8em; margin: 0 0.2em; }
}

/* Kurzes Viewport (z. B. Landscape): Layout kompakter, Koordinaten unverändert */
@media (max-height: 500px) and (min-width: 701px) {
  #center-wrapper {
    min-width: 85vw;
    max-width: 98vw;
    padding-top: 0.2em;
    margin-bottom: 2em;
  }
  .quad { font-size: clamp(2.5em, 12vh, 6em); }
  #subtitle {
    margin-top: 0.75em; margin-bottom: 0.4em;
    font-size: clamp(0.6em, 3vh, 1.4em);
    line-height: 1.2;
  }
  #slogan {
    margin-top: 0.4em;
    font-size: clamp(0.55em, 2.5vh, 1.1em);
    line-height: 1.3;
  }
}

@media (max-height: 500px) and (max-width: 700px) {
  #center-wrapper {
    padding-top: 0.15em;
    margin-bottom: 1.5em;
  }
}

@media (max-height: 850px) {
  #center-wrapper {
    padding-top: clamp(0.5em, 1.2vw, 1.2em);
  }
  #services-section {
    margin-top: 1rem;
    padding-top: 1em; padding-bottom: 1em;
  }
  #cta-terminal {
    margin-top: 1em; margin-bottom: 1em;
  }
  #identity-links {
    margin-top: 1em; margin-bottom: 1.5em;
  }
  #subtitle {
    margin-top: 1em;
  }
  #slogan {
    margin-top: 1em;
  }
}
