/* About / Works / Contact: one restrained window language, without rewriting content. */
@media (min-width: 761px) {
  .content-panel .content-panel__surface {
    --panel-corner: clamp(16px, 1.45vw, 23px);
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: var(--panel-corner);
    box-shadow: 0 28px 96px rgba(0, 0, 0, .6);
    background-color: #080808;
    background-clip: padding-box;
    overflow: hidden;
    isolation: isolate;
  }

  .content-panel .content-panel__surface::before {
    border-radius: inherit;
  }

  /* The actual node canvas remains full-bleed; the outer shell owns clipping. */
  .work-archive .content-panel__surface--works .work-canvas {
    border-radius: inherit;
    overflow: hidden;
  }
}

/* No extra cards, glows or rewritten typography. */
.content-panel .content-panel__close.modal-close--edge {
  --modal-close-line: rgba(255, 255, 255, .13);
  z-index: 12;
  border-top: 0;
  border-right: 0;
  border-left: 1px solid var(--modal-close-line);
  border-bottom: 1px solid var(--modal-close-line);
  border-radius: 0 0 0 13px;
  background: #0b0b0c;
  color: rgba(255, 255, 255, .75);
  box-shadow: none;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

.content-panel .content-panel__close.modal-close--edge:hover,
.content-panel .content-panel__close.modal-close--edge:focus-visible {
  border-color: rgba(255, 255, 255, .25);
  background: #1a1a1b;
  color: #fff;
}

.content-panel .content-panel__close.modal-close--edge:focus-visible {
  outline: 1px solid rgba(255, 255, 255, .72);
  outline-offset: -4px;
}

/* About's X sits inside the bottom information bar, not the outer top edge. */
.content-panel__surface--about .about-info-bar .modal-close--about {
  border-radius: 0 0 0 13px;
}

/* Contact's X belongs to the inset form and follows that form's upper corner. */
@media (min-width: 901px) {
  .content-panel__surface--contact .contact-form {
    border-radius: 16px;
    overflow: hidden;
  }

  .content-panel__surface--contact .modal-close--contact {
    border: 1px solid rgba(255, 255, 255, .13);
    border-top: 0;
    border-right: 0;
    border-radius: 0 16px 0 13px;
    background: #0b0b0c;
  }

  .content-panel__surface--contact .modal-close--contact:hover,
  .content-panel__surface--contact .modal-close--contact:focus-visible {
    border-color: rgba(255, 255, 255, .25);
    background: #1a1a1b;
    color: #fff;
  }
}

/* Full-screen mobile panels must stay flush to the screen (safe-area + scroll).
   The softer X corner is kept without introducing inaccessible rounded gutters. */
@media (max-width: 760px) {
  .content-panel .content-panel__surface {
    border-radius: 0;
  }

  .content-panel .content-panel__close.modal-close--edge {
    border-radius: 0 0 0 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .content-panel .content-panel__close.modal-close--edge {
    transition: none;
  }
}
