/*   = = =   Modal Frame : Nox Cella's dialog   = = =   */

/* - - - EVERY VISITOR'S SINCE 2026-11-03 (the owner's word : "When a button is pressed, it will open a modal of my
   styling"): every window ModalFrame-Script.js makes, a role's Technologies • Experience window (Technologies-
   Script.js) and the owner's tools' alike, drawn as Nox Cella draws its dialogs : an overlay whose ::before is the
   VEIL (the page dimmed and blurred behind), a square frame on an accent hairline with no fill of its own, a header
   and a footer BAND frosted over the body that scrolls under them. Moved whole, rule for rule, out of
   EffectsEditor-Styling.css, which stays the owner's alone and keeps what only its tools use (the peek). Every colour is a theme token.

   NEVER GIVE THE OVERLAY OR THE FRAME a backdrop-filter, a filter, an opacity under 1 or a mask while it is open :
   it becomes the backdrop root and the bands' frost blurs an empty canvas (Nox Cella's rule). The veil is the
   overlay's ::before, a sibling of the frame, for that reason, and the frame's own fade lasts only its opening.

   THE ISLAND STAYS OVER THE WINDOWS (1500 over 1400), as Nox Cella's dock stays over its hubs : the frame ends above
   it, at `--nk-modal-foot`, measured by the script. ITS ROOM IS EVEN (2026-11-18, the owner's word : "completely get
   rid of it so that the modals especially on mobile device screens take the even screen distribution") : no corner
   icon, so nothing pushes a tall window down ; the frame stands centred between the screen's top and the island, 12px
   from each at the most. - - - */



/*   = = = = = =   The Overlay and Its Veil   = = = = = =   */

.modal-overlay
{
    --nk-hairline: calc(0.05rem + 0.05vw);
    --nk-modal-in: 220ms;
    --nk-modal-out: 160ms;
    --nk-modal-ease: 200ms;
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(12px, env(safe-area-inset-top, 0px)) 12px var(--nk-modal-foot, calc(96px + env(safe-area-inset-bottom, 0px)));
    color: var(--text-main);
}
.modal-overlay[hidden] { display: none; }

/* - - - THE PAGE HELD STILL (2026-11-03, the owner's word : "Forbid movement (scrolling up and down) on both mobile and
   desktop of the interface, while the modals are opened") : while a window that asks for it is open
   (ModalFrame-Script.js, `lockScroll`, a role's Technologies • Experience window), <html> wears `nk-modal-locked`
   and the BODY's overflow is hidden, which the page's scroll takes (the root's own is visible, so the body's
   overflow is the viewport's ; hidden on the root, the body, `overflow-x: hidden` already, would scroll inside
   itself). No finger, wheel or key moves the page ; the window's body still scrolls, and a finger on the veil pans
   nothing (`touch-action`). - - - */
html.nk-modal-locked body
{
    overflow: hidden;
}
html.nk-modal-locked .modal-overlay.is-tech
{
    touch-action: none;
}
html.nk-modal-locked .modal-overlay.is-tech .context-modal
{
    touch-action: pan-y;
}
.modal-overlay.is-notice { z-index: 1450; }

/* - - - THE VEIL IS A BOKEH BLUR, NOT A DIMMING (2026-11-03, the owner's word : "Remove completely the dim of thr
   background when the modals open and replace it instead with a blue filter with exaggerated bokeh above any colour of
   the background", then "No blue. BOKEH") : nothing laid over the page and nothing darkened ; the page itself, through
   a backdrop filter, in its own colours, blurred far more than before (28px, from 16) with its light pushed up
   (brightness, contrast, a little more saturation), so every lit point of whatever lies behind (the tower, a panel, a
   picture) blooms into a wide soft disc of its own colour : the bokeh. BOTH ARE THE EFFECTS EDITOR'S ("The windows'
   background", Nk-Config.php `modalVeil` ; the owner's word : "Add as an option to intensity of both blur and
   boheh") : `--nk-veil-blur` (28px) and `--nk-veil-bokeh` (1), which scales the push (brightness 0.35, contrast 0.25,
   saturation 0.3 above 1, at 1) ; 0 is a plain blur. Till then (Nox Cella's veil) the page was dimmed
   by 72% under a 16px blur. It comes after the frame has begun to show and goes after the frame has begun to go ;
   once settled, a peek lifts and lowers it at once. - - - */
.modal-overlay::before
{
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: none;
    -webkit-backdrop-filter: blur(var(--nk-veil-blur, 28px)) brightness(calc(1 + 0.35 * var(--nk-veil-bokeh, 1))) contrast(calc(1 + 0.25 * var(--nk-veil-bokeh, 1))) saturate(calc(1 + 0.3 * var(--nk-veil-bokeh, 1)));
    backdrop-filter: blur(var(--nk-veil-blur, 28px)) brightness(calc(1 + 0.35 * var(--nk-veil-bokeh, 1))) contrast(calc(1 + 0.25 * var(--nk-veil-bokeh, 1))) saturate(calc(1 + 0.3 * var(--nk-veil-bokeh, 1)));
    opacity: 0;
    transition: opacity calc(var(--nk-modal-out) * 2) ease-in-out var(--nk-modal-out);
}
.modal-overlay.show::before
{
    opacity: 1;
    transition: opacity var(--nk-modal-in) ease-in-out calc(var(--nk-modal-in) / 2);
}
.modal-overlay.show.is-settled::before
{
    transition: opacity var(--nk-modal-ease) ease-in-out;
}



/*   = = = = = =   The Frame   = = = = = =   */

/* - - - EVERY WINDOW ONE WIDTH, EVERY TITLE ON ONE LINE (2026-11-10, the owner's word : "for all modals to have the same
   width and have all fit the titles fit inlije rather than to be split and break onto a new line") : no window sets a
   width of its own. The frame is the widest title any window on the page has, at the title's size, plus the band's
   sides, held to the screen ; `--nk-modal-title-ems` is that title's width in ems, measured on the device's own font
   (`titleEms`, ModalFrame-Script.js). Where the screen is narrower than that, the titles shrink together (`100cqi`
   over that figure, the header section a size container), so no screen breaks one. - - - */
:root
{
    --nk-modal-title-size: clamp(14px, calc(0.75rem + 0.75vw), 34px);
    --nk-modal-title-track: 0.133;
    --nk-modal-head-side: calc(0.75rem + 0.5vw);
}

/* - - - Square, no fill, no blur of its own (the veil is its ground), one hairline at 30% of the accent. The frame is
   the one scroller : its bands stick to its top and foot, and the body passes under them. It grows with what it
   holds, up to the room between the screen's top and the island. Its fade in is a plain fade, Nox Cella's. - - - */
.modal-overlay .glass-modal-content.context-modal
{
    position: relative;
    display: block;
    width: min(100%, calc(var(--nk-modal-title-ems, 24) * var(--nk-modal-title-size) + 2 * var(--nk-modal-head-side) + 2px));
    max-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    scroll-padding: 5rem 0;
    border: 1px solid rgba(var(--accent-rgb), 0.3);
    border-radius: 0;
    background: transparent;
    outline: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--nk-modal-out) ease-in-out, visibility 0s linear var(--nk-modal-out),
                border-color var(--nk-modal-ease) ease-in-out;
}
.modal-overlay .context-modal::-webkit-scrollbar { display: none; }
.modal-overlay.show .glass-modal-content.context-modal
{
    opacity: 1;
    visibility: visible;
    transition: opacity var(--nk-modal-in) ease-in-out, visibility 0s linear,
                border-color var(--nk-modal-ease) ease-in-out;
}



/*   = = = = = =   The Bands   = = = = = =   */

/* - - - Nox Cella's header and footer bands : black at 30% over a 5px frost, an accent hairline at 55% between each
   and the body, floating over what scrolls under them. - - - */
.modal-overlay .context-modal-header,
.modal-overlay .context-modal-footer
{
    position: sticky;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    background-image: linear-gradient(rgba(var(--panel-rgb), 0.3), rgba(var(--panel-rgb), 0.3));
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    transition: opacity var(--nk-modal-ease) ease-in-out;
}
.modal-overlay .context-modal-header
{
    top: 0;
    padding: 0 var(--nk-modal-head-side);
    border-bottom: var(--nk-hairline) solid rgba(var(--accent-rgb), 0.55);
}
.modal-overlay .context-modal-footer
{
    bottom: 0;
    padding: 5px calc(0.75rem + 1.5vw);
    border-top: var(--nk-hairline) solid rgba(var(--accent-rgb), 0.55);
}
.modal-overlay .Modal-HeaderSection,
.modal-overlay .Modal-FooterSection
{
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}
.modal-overlay .Modal-FooterSection
{
    gap: 8px;
    margin: calc(0.3rem + 0.3svh) 0;
}
.modal-overlay .Modal-HeaderSection
{
    container-type: inline-size;
}

/* - - - The title : uppercase in the accent, tracked, centred, its size following the screen as Nox Cella's does
   (bounded, so the 4K desktop's is not twice the phone's twice over). Under it the sub-title, muted. - - - */
.modal-overlay .Modal-SectionTitle
{
    padding: calc(0.75rem + 0.3vw) 0 calc(0.4rem + 0.15vw);
    font-size: min(var(--nk-modal-title-size), calc(100cqi / var(--nk-modal-title-ems, 24)));
    letter-spacing: calc(var(--nk-modal-title-track) * 1em);
    text-indent: calc(var(--nk-modal-title-track) * 1em);
    white-space: nowrap;
    line-height: 1.2;
    text-transform: uppercase;
    text-align: center;
    color: var(--primary-color);
}
.modal-overlay .context-modal-sub
{
    padding-bottom: calc(0.45rem + 0.15vw);
    font-size: clamp(9.5px, calc(0.42rem + 0.15vw), 14px);
    letter-spacing: 0.2em;
    text-indent: 0.2em;
    text-transform: uppercase;
    text-align: center;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}
.modal-overlay .context-modal-sub:empty { display: none; }

/* - - - The footer's one line of news (saved, an error, how many changes wait), over its buttons. - - - */
.modal-overlay .nk-modal-status
{
    min-height: 1.5em;
    font-size: clamp(9.5px, calc(0.42rem + 0.15vw), 14px);
    line-height: 1.5;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: center;
    color: var(--text-muted);
    transition: color var(--nk-modal-ease) ease-in-out;
}
.modal-overlay .nk-modal-status:empty { display: none; }
.modal-overlay .nk-modal-status.is-bad { color: var(--danger-text); }
.modal-overlay .nk-modal-actions
{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}
.modal-overlay .nk-modal-actions[hidden] { display: none; }



/*   = = = = = =   The Body   = = = = = =   */

.modal-overlay .context-modal-body
{
    position: relative;
    z-index: 1;
    padding: calc(0.75rem + 0.6vw) calc(0.75rem + 1.5vw);
    transition: opacity var(--nk-modal-ease) ease-in-out;
}

/* - - - Nox Cella's narrative : small capitals, muted, centred. - - - */
.modal-overlay .Modal-Narrative
{
    font-size: clamp(10.5px, calc(0.5rem + 0.12vw), 14px);
    line-height: 1.6;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    color: var(--text-muted);
}
.modal-overlay .Modal-Narrative.is-bad { color: var(--danger-text); }



/* - - - Author : Nikolaos S. Kaounas - - - */
