/* DESKTOP WINDOW MANAGER */
@media (min-width: 701px) {
  html, body { overflow: hidden !important; height: 100% !important; }
  #page-wrap  { overflow: hidden !important; height: calc(100vh - 70px) !important; opacity: 0 !important; visibility: hidden !important; }

  /* Section wrappers are invisible mounting points — windows are fixed */
  .hero, .explorer-wrap, .contact-wrap {
    padding: 0 !important; margin: 0 !important;
    height: 0 !important; overflow: visible !important;
    border: none !important;
  }

  .win-window.is-draggable { position: fixed; z-index: 100; transition: box-shadow 0.15s; }
  .win-window.is-draggable:hover { box-shadow: 4px 4px 0 rgba(0,0,0,0.6), 0 0 40px rgba(155,127,189,0.2); }
  .win-window.is-draggable.is-dragging { box-shadow: 6px 6px 0 rgba(0,0,0,0.7), 0 0 50px rgba(155,127,189,0.25); opacity: 0.95; }

  .win-titlebar { cursor: move; user-select: none; }
  .win-btn      { user-select: none; }
  .win-window.is-hidden   { display: none !important; }
  .win-window.is-maximised { left: 0 !important; overflow: hidden; }
  .win-window.is-maximised .win-body { overflow: auto; }

  .win-btn:hover  { background: rgba(155,127,189,0.3); cursor: pointer; }
  .win-btn:active {
    border-top:   1px solid rgba(0,0,0,0.7);
    border-left:  1px solid rgba(0,0,0,0.7);
    border-right: 1px solid rgba(232,230,224,0.3);
    border-bottom:1px solid rgba(232,230,224,0.3);
  }

  /* Explorer resize handles — positioned by JS */
  .resize-handle { position: fixed; z-index: 99999; background: transparent; }
  .resize-handle[data-dir="n"], .resize-handle[data-dir="s"] { height: 6px; cursor: ns-resize; }
  .resize-handle[data-dir="e"], .resize-handle[data-dir="w"] { width:  6px; cursor: ew-resize; }
  .resize-handle[data-dir="nw"] { width: 12px; height: 12px; cursor: nw-resize; }
  .resize-handle[data-dir="ne"] { width: 12px; height: 12px; cursor: ne-resize; }
  .resize-handle[data-dir="sw"] { width: 12px; height: 12px; cursor: sw-resize; }
  .resize-handle[data-dir="se"] { width: 12px; height: 12px; cursor: se-resize; }
}


/* Slightly more breathing room on desktop */
@media (min-width: 701px) {
  .hero, .explorer-wrap, .contact-wrap {
    padding-left: 36px;
    padding-right: 36px;
  }
}


@media (min-width: 701px) {
  .welcome-wrap {
    padding-left: 36px;
    padding-right: 36px;
  }
}


@media (min-width: 701px) {
  .contact-launch-wrap {
    display: none !important;
  }
}


@media (min-width: 701px) {
  .contact-launch-wrap,
  #contact-launch-btn {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}


@media (min-width: 701px) {
  #page-wrap.boot-ready {
    opacity: 1 !important;
    visibility: visible !important;
    transition: opacity 0.12s linear;
  }
}


/* COMPACT MODE: degraded desktop stack for constrained non-mobile viewports */
@media (min-width: 701px) {
  html.compact-mode,
  html.compact-mode body {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    height: auto !important;
  }

  html.compact-mode #page-wrap {
    height: auto !important;
    overflow: visible !important;
    opacity: 0 !important;
    visibility: hidden !important;
    padding-top: 70px !important;
  }

  html.compact-mode #page-wrap.boot-ready {
    opacity: 1 !important;
    visibility: visible !important;
  }

  html.compact-mode .welcome-wrap,
  html.compact-mode .hero,
  html.compact-mode .explorer-wrap,
  html.compact-mode .contact-wrap {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
    padding: 18px 20px 0 !important;
    margin: 0 !important;
    border: none !important;
  }

  html.compact-mode .contact-wrap {
    padding-bottom: 28px !important;
  }

  html.compact-mode .win-window {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    margin: 0 auto !important;
    display: block !important;
    z-index: auto !important;
    transform: none !important;
  }

  html.compact-mode .hero .win-window,
  html.compact-mode .explorer-wrap .win-window,
  html.compact-mode .contact-wrap .win-window {
    margin-top: 0 !important;
  }

  html.compact-mode .hero {
    padding-top: 0 !important;
  }

  html.compact-mode .hero-pre {
    height: 150px !important;
  }

  html.compact-mode .contact-modal-window .win-body,
  html.compact-mode .explorer-window .explorer-body {
    height: auto !important;
    overflow: visible !important;
  }

  html.compact-mode .resize-handle,
  html.compact-mode #taskbar,
  html.compact-mode #start-menu,
  html.compact-mode .taskbar,
  html.compact-mode .tray,
  html.compact-mode .contact-launch-wrap,
  html.compact-mode .mobile-contact-footer,
  html.compact-mode #mobile-nav {
    display: none !important;
  }

  html.compact-mode .explorer-window .explorer-content {
    min-height: 420px;
  }

  html.compact-mode .contact-wrap {
    max-width: 1180px;
    margin: 0 auto;
  }

  html.compact-mode #compact-mode-note {
    display: block;
  }
}
