/**
 * Mobile/Tablet Layout — lädt zuletzt (nach Inline-Styles)
 * Scroll-Modell, Safe-Area, keine festen vh-Hero-Höhen
 * Desktop ≥1025px: keine Regeln
 */

@media (max-width: 1024px) {
  html.welten-mobile {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    --dock-h: 0px !important;
  }

  html.welten-mobile,
  html.welten-mobile body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: hidden;
    height: 100%;
    min-height: 100%;
    margin: 0;
    touch-action: pan-y;
  }

  /* Ein Scroll-Container: aktive Folie */
  main.slides-root,
  #slidesRoot {
    position: relative;
    box-sizing: border-box;
    height: calc(100svh - var(--header-h, 56px) - var(--dock-h, 0px));
    height: calc(100dvh - var(--header-h, 56px) - var(--dock-h, 0px));
    min-height: calc(100svh - var(--header-h, 56px) - var(--dock-h, 0px));
    min-height: calc(100dvh - var(--header-h, 56px) - var(--dock-h, 0px));
    overflow: hidden;
  }

  .slide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .slide.active {
    position: absolute !important;
    inset: 0;
    top: var(--header-h, 56px);
    bottom: var(--dock-h, 0px);
    left: 0;
    right: 0;
    width: 100%;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 2;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: auto;
    touch-action: pan-y;
  }

  /* NEXORA Inline (#force-nexora-final-brain-hero) + welten-ui-v10 */
  #slide-home .home-hero-experience,
  #slide-home #dnaStage.home-hero-experience {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    touch-action: pan-y !important;
  }

  #slide-home .nexora-orbit-buttons,
  #slide-home .nexora-orbit-buttons.welten-nexora-list-mode,
  html.welten-nexora-list #slide-home .nexora-orbit-buttons {
    position: relative;
    top: auto;
    bottom: auto;
    left: auto;
    right: auto;
    inset: auto;
    transform: none;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    margin: 0 auto;
    padding: 0 0 8px;
    perspective: none;
    pointer-events: auto;
  }

  #slide-home .neuro-core,
  #slide-home .nexora-orbit-nav,
  #slide-home .nexora-orbit-nav--lr {
    display: none;
    pointer-events: none;
  }

  #slide-home .slide-inner--home,
  #slide-home .home-main-block {
    position: relative;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    overflow: visible;
    min-height: min-content;
    max-width: 100%;
  }

  #slide-home .home-hero-experience,
  #slide-home .dna-unified-scene {
    flex-shrink: 0;
    overflow: visible;
    max-width: 100%;
  }

  /* PROFESSIONAL: kein riesiges Pseudo-Wasserzeichen auf Touch */
  body[data-world="vertex"] #slide-home .dna-unified-scene::before {
    display: none;
  }

  body[data-world="vertex"] .home-hero-experience,
  body[data-world="vertex"] .dna-unified-scene,
  body[data-world="freiraum"] .home-hero-experience,
  body[data-world="freiraum"] .dna-unified-scene,
  body[data-world="nexora"] .home-hero-experience {
    min-height: 0;
    max-height: none;
    height: auto;
  }

  body[data-world="nexora"] #slide-home .home-hero-experience.is-dragging,
  body[data-world="nexora"] #slide-home #dnaStage.is-dragging {
    touch-action: pan-y;
    overflow: visible;
    pointer-events: auto;
  }

  /* Safe-Area iOS */
  .site-header {
    padding-top: max(var(--header-air-top, 8px), env(safe-area-inset-top, 0px));
    padding-left: max(clamp(12px, 3vw, 32px), env(safe-area-inset-left, 0px));
    padding-right: max(clamp(8px, 2.2vw, 22px), env(safe-area-inset-right, 0px));
  }

  .chapter-dock {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    pointer-events: none !important;
    overflow: hidden !important;
  }

  html.welten-mobile main.slides-root,
  html.welten-mobile #slidesRoot {
    padding-bottom: 0 !important;
  }

  html.welten-mobile .slide.active {
    bottom: 0 !important;
  }

  .slide:not(#slide-home) {
    padding-bottom: max(clamp(24px, 6vw, 48px), env(safe-area-inset-bottom, 0px));
  }

  .menu-overlay:not(.open) {
    pointer-events: none;
  }

  /* Kein horizontaler Overflow */
  .slide-inner,
  .home-layout,
  .card-grid,
  .glass-card,
  img,
  video {
    max-width: 100%;
  }

  .header-left {
    flex-wrap: wrap;
    row-gap: 6px;
    max-width: calc(100% - 88px);
  }

  html.welten-mobile body.is-dragging,
  html.welten-mobile #dnaStage.is-dragging,
  html.welten-mobile .home-hero-experience.is-dragging {
    touch-action: pan-y;
    overflow: visible;
  }

  .bg-root,
  .bg-grid,
  .light-beams,
  #particle-canvas,
  #dnaPremiumCanvas,
  #dnaParticlesCanvas,
  .dna-particles-canvas,
  .dna-premium-canvas,
  #weltenMousePaintCanvas {
    pointer-events: none;
    z-index: 0;
  }

  body[data-world="freiraum"] #slide-home .home-main-block .home-portrait-card,
  body[data-world="freiraum"] #slide-home .home-main-block .portrait-photo,
  body[data-world="freiraum"] #slide-home .home-main-block img#heroPhoto {
    display: block;
    visibility: visible;
    opacity: 1;
  }

  body[data-world="freiraum"] .home-main-block .portrait-photo,
  body[data-world="freiraum"] .contact-visual .portrait-photo {
    mix-blend-mode: normal;
  }

  a[href^="mailto:"],
  a[href^="tel:"],
  .site-header .header-meta[href^="mailto:"],
  .site-header .header-meta[href^="tel:"] {
    pointer-events: auto;
    touch-action: manipulation;
    cursor: pointer;
    position: relative;
    z-index: 10090;
  }

  .slide-inner {
    padding-bottom: 0;
    margin-bottom: 0;
  }
}

/* NEXORA Mobile Scroll — nur ≤1024px (Desktop-Hero unberührt) */
@media (max-width: 1024px) {
  html.welten-mobile body[data-world="nexora"] #slide-home.slide,
  html.welten-mobile body[data-world="nexora"] #slide-home.slide.active {
    position: absolute !important;
    top: var(--header-h, 56px) !important;
    bottom: var(--dock-h, 0px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
  }

  html.welten-mobile body[data-world="nexora"] #slide-home .home-hero-experience,
  html.welten-mobile body[data-world="nexora"] #slide-home #dnaStage {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    touch-action: pan-y !important;
    display: flex !important;
    flex-direction: column !important;
  }

  html.welten-mobile body[data-world="nexora"] #slide-home .nexora-orbit-buttons,
  html.welten-mobile body[data-world="nexora"] #slide-home .nexora-orbit-ring,
  html.welten-mobile body[data-world="nexora"] #slide-home .nexora-orbit-button,
  html.welten-mobile body[data-world="nexora"] #slide-home .welten-mobile-hero-title,
  html.welten-mobile body[data-world="nexora"] #slide-home .welten-mobile-hero-meta {
    touch-action: pan-y !important;
  }

  html.welten-mobile body[data-world="nexora"] #slide-home .nexora-orbit-buttons {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    pointer-events: auto !important;
  }
}
