/* Scoped to the Marketplace shell and the scenic dashboard. */
:root {
    --scenic-navy: #081529;
    --scenic-glass: rgba(15, 32, 53, .93);
    --scenic-line: rgba(180, 207, 242, .20);
    --scenic-ink: #f4f7ff;
    --scenic-muted: #c2d2e6;
    --scenic-accent: #a4d5ff;
}
.scenic-active { background: var(--scenic-navy); }
.scenic-active .workspace { background: var(--scenic-navy); }
.scenic-active .content { max-width: none; padding: 0; }
:is(.scenic-active, .scenic-glass-on) .sidebar {
    background: #09192f;
    color: var(--scenic-ink);
    border-right: 1px solid var(--scenic-line);
}
:is(.scenic-active, .scenic-glass-on) .sidebar .brand,
:is(.scenic-active, .scenic-glass-on) .sidebar .brand strong { color: var(--scenic-ink); }
:is(.scenic-active, .scenic-glass-on) .sidebar .brand small,
:is(.scenic-active, .scenic-glass-on) .sidebar .nav-label,
:is(.scenic-active, .scenic-glass-on) .sidebar .sidebar-foot { color: var(--scenic-muted); }
:is(.scenic-active, .scenic-glass-on) .sidebar .nav button { color: #dbe8f9; }
:is(.scenic-active, .scenic-glass-on) .sidebar .nav button:hover,
:is(.scenic-active, .scenic-glass-on) .sidebar .nav button.active { background: #1b3656; color: white; }
:is(.scenic-active, .scenic-glass-on) .topbar {
    background: #0b1b32;
    color: white;
    border-color: var(--scenic-line);
}
:is(.scenic-active, .scenic-glass-on) .topbar strong, :is(.scenic-active, .scenic-glass-on) .topbar .small,
:is(.scenic-active, .scenic-glass-on) .topbar .text { color: white; }
:is(.scenic-active, .scenic-glass-on) .topbar select { background: #172b47; color: white; border-color: var(--scenic-line); }
:is(.scenic-active, .scenic-glass-on) .profile-mode-bar {
    background: #10213a;
    border-color: var(--scenic-line);
}
:is(.scenic-active, .scenic-glass-on) .profile-mode-bar .current-profile-label { color: #c6d7eb; }
:is(.scenic-active, .scenic-glass-on) .profile-mode-bar .profile-mode { background: #182d47; color: #f1f7ff; border-color: #4c6a8d; }
:is(.scenic-active, .scenic-glass-on) .profile-mode-bar .profile-mode.selected { background: #d9ebff; color: #122b49; }
:is(.scenic-active, .scenic-glass-on) .marketplace-global { background: #071326; border-color: var(--scenic-line); }
:is(.scenic-active, .scenic-glass-on) .marketplace-global a { color: #d6e7fc; }
:is(.scenic-active, .scenic-glass-on) .marketplace-global a:hover { color: white; }
.scenic-active .dev-strip { display: none; }
:is(.scenic-active, .scenic-glass-on) .topbar, :is(.scenic-active, .scenic-glass-on) .profile-mode-bar { padding-block: 10px; }
:is(.scenic-active, .scenic-glass-on) .breadcrumb, :is(.scenic-active, .scenic-glass-on) .profile-mode small { color: #c6d7eb; }
:is(.scenic-active, .scenic-glass-on) .sidebar .nav button { padding-block: 9px; min-height: 38px; }

.scenic-home {
    isolation: isolate;
    position: relative;
    overflow: clip;
    min-height: calc(100vh - 180px);
    padding: clamp(16px, 2.7vw, 46px) clamp(18px, 3.4vw, 55px);
    color: var(--scenic-ink);
    background: #0c1a2c;
}
.scenic-background {
    position: absolute;
    z-index: -1;
    inset: 0 0 auto;
    height: min(850px, 100%);
    background-color: #0a1d36;
    background-image: linear-gradient(180deg, transparent 15%, #0c1a2c 100%), radial-gradient(ellipse at 70% 20%, #263d61, #101d33 78%);
    background-position: center;
    background-size: cover;
}
/* Media is mounted only when its scene is selected. */
.scenic-background { overflow: hidden; pointer-events: none; filter: brightness(var(--scenic-brightness, 1)); }
.scenic-background img, .scenic-background video {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    object-fit: cover;
}
.scenic-background img[hidden] { display: none; }
.scenic-background video { visibility: hidden; }
.scenic-background .scenic-video-ready { visibility: visible; }
.scenic-background::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, rgba(6,15,31,.83), rgba(6,15,31,.35)),
        linear-gradient(180deg, transparent 25%, #0c1a2c 100%);
}
[data-scene="professional"] { background-image: linear-gradient(145deg,#183454,#0c192d); }
[data-scene="soft-gradient"] { background-image: linear-gradient(140deg,#3b5373,#121b39 55%,#37445f); }
.scenic-moving img { animation: scenic-drift 24s ease-in-out infinite alternate; }
.scenic-action-motion img { animation: scenic-pan 9s ease-in-out infinite alternate; }
.scenic-action-motion:has(.scenic-video-ready) img { animation: none; }
@keyframes scenic-drift { from { transform: scale(1); } to { transform: scale(1.055); } }
@keyframes scenic-pan { from { transform: scale(1.02); } to { transform: scale(1.14) translateX(-2%); } }

.scenic-glass-on { isolation: isolate; }
.scenic-glass-on > .scenic-background { position: fixed; inset: 0; height: auto; }
.scenic-glass-on > .scenic-background::after { content: none; }
.scenic-glass-on :is(.workspace, .scenic-home) { background: transparent; }
.scenic-glass-on :is(.sidebar, .topbar, .profile-mode-bar, .marketplace-global,
    .scenic-card, .scenic-hero, .scenic-gallery, .scenic-loading, .scenic-projects li) {
    background: rgba(12, 26, 44, var(--scenic-opacity,.35));
}
.scenic-glass-on .scenic-hero {
    border: 1px solid var(--scenic-line);
    border-radius: 16px;
    padding-inline: clamp(12px, 2vw, 24px);
    margin-bottom: 14px;
}
.scenic-glass-on :is(.sidebar, .topbar, .profile-mode-bar, .marketplace-global, .scenic-home, .scenic-gallery) {
    text-shadow: 0 1px 3px #050d19, 0 0 5px #050d19, 0 0 9px #050d19;
}
.scenic-glass-on :is(button, input, textarea, select, .scenic-metrics strong, .profile-mode) { text-shadow: none; }
.scenic-glass-on .scenic-gallery::backdrop {
    background: rgba(2,10,21,.44);
    backdrop-filter: blur(5px);
}
.scenic-glass-on .scenic-gallery input, .scenic-glass-on .scenic-gallery select { color-scheme: dark; }

@keyframes scenic-welcome-settle { from { opacity: 1; } to { opacity: .86; } }

.scenic-hero { position: relative; padding: 22px 0 26px; max-width: 1300px; margin: 0 auto; }
.scenic-kicker, .scenic-tagline { font-size: .75rem; letter-spacing: .135em; font-weight: 800; }
.scenic-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 13px; }
.scenic-kicker span { border-left: 1px solid #94b4d3; padding-left: 13px; color: #e1ecf8; }
.scenic-tagline { color: #cce4ff; margin: 9px 0 15px; }
.scenic-hero h1 {
    font-size: clamp(2.15rem, 5vw, 4.25rem);
    letter-spacing: -.06em;
    line-height: 1.06;
    max-width: 18ch;
    overflow-wrap: anywhere;
    color: white;
    margin: 12px 0 10px;
}
.scenic-hero > p:not(.scenic-tagline) { color: #edf5ff; font-size: 1rem; margin: 0 0 20px; max-width: 55ch; }
.scenic-welcome { animation: scenic-welcome-settle .6s ease 6s forwards; }
.scenic-button, .scenic-link, .scenic-nav-toggle {
    font: inherit;
    font-weight: 750;
    border-radius: 10px;
    cursor: pointer;
}
.scenic-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 14px;
    border: 1px solid #8aa9c9;
    background: #102846;
    color: white;
}
.scenic-button:hover { background: #1c3b5f; color: white; }
.scenic-button-light { background: #dceeff; border-color: #dceeff; color: #0b2c50; }
.scenic-button-light:hover { background: white; color: #0b2c50; }
.scenic-home-controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.scenic-home-controls > button:disabled { opacity: .65; cursor: default; }
.scenic-home svg, .scenic-gallery svg, .scenic-post svg { width: 20px; height: 20px; flex: 0 0 auto; }
.scenic-search {
    display: flex;
    align-items: center;
    max-width: 640px;
    background: rgba(6, 18, 34, .89);
    border: 1px solid #708eac;
    border-radius: 13px;
    padding: 5px 5px 5px 14px;
    gap: 8px;
}
#scenic-search-query {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 40px;
    border: 0;
    background: transparent;
    color: white;
    font-size: 1rem;
    padding: 8px 3px;
}
#scenic-search-query::placeholder { color: #d0dff3; }
.scenic-actions, .scenic-grid { max-width: 1300px; margin-inline: auto; display: grid; gap: 12px; }
.scenic-actions { grid-template-columns: repeat(6,minmax(0,1fr)); margin-bottom: 22px; }
.scenic-action {
    display: grid;
    justify-items: start;
    align-content: center;
    gap: 9px;
    min-width: 0;
    min-height: 94px;
    padding: 11px 13px;
    border: 1px solid rgba(255,255,255,.32);
    border-radius: 13px;
    text-align: left;
    font: inherit;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(5,12,26,.23);
}
.scenic-action:hover { filter: brightness(1.16); }
.scenic-action svg { width: 24px; height: 24px; }
.scenic-action-0 { background: #205a92; }
.scenic-action-1 { background: #196457; }
.scenic-action-2 { background: #53468f; }
.scenic-action-3 { background: #905022; }
.scenic-action-4 { background: #24598c; }
.scenic-action-5 { background: #823f63; }

.scenic-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; align-items: stretch; }
.scenic-card {
    min-width: 0;
    border: 1px solid var(--scenic-line);
    border-radius: 16px;
    padding: 17px 18px;
    background: var(--scenic-glass);
    box-shadow: 0 12px 30px rgba(2,9,22,.2);
}
.scenic-card h2 { display: flex; align-items: center; gap: 9px; color: white; font-size: 1.07rem; margin: 0 0 12px; }
.scenic-card h2 svg { color: #a5d4ff; }
.scenic-card p, .scenic-card li, .scenic-card dt { color: var(--scenic-muted); font-size: .89rem; }
.scenic-card p { margin: 0 0 12px; }
.scenic-card .scenic-note { margin: 10px 0 0; }
.scenic-link {
    color: #16456c;
    background: transparent;
    border: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 4px 0;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-align: left;
}
.scenic-card .scenic-link { color: var(--scenic-accent); }
.scenic-link svg { width: 15px; height: 15px; }
.scenic-note { font-size: .82rem; }
.scenic-metrics, .scenic-timeline, .scenic-projects { padding: 0; margin: 0; list-style: none; }
.scenic-metrics button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 0;
    border-bottom: 1px solid var(--scenic-line);
    background: transparent;
    color: #e2edfc;
    font: inherit;
    font-size: .87rem;
    padding: 6px 0;
    min-height: 35px;
    text-align: left;
    cursor: pointer;
}
.scenic-metrics button:hover { color: white; text-decoration: underline; }
.scenic-metrics button svg { width: 16px; height: 16px; color: #a5d4ff; }
.scenic-metrics strong { margin-left: auto; min-width: 26px; text-align: center; color: #f7fbff; background: #28425f; border-radius: 5px; }
.scenic-projects { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px 9px; margin: 12px 0; }
.scenic-projects li { font-size: .77rem; padding: 5px 7px; border-radius: 6px; background: #263c58; color: #e1efff; }
.scenic-tasks { margin: 0 0 10px; }
.scenic-tasks > div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--scenic-line); }
.scenic-tasks dd { margin: 0; font-weight: 800; }
.scenic-timeline li { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--scenic-line); }
.scenic-timeline button { font: inherit; color: inherit; text-align: left; border: 0; background: transparent; padding: 2px 0; cursor: pointer; text-decoration: underline; }
.scenic-timeline time { font-size: .74rem; text-align: right; opacity: .9; }
.scenic-shortcuts { display: grid; }
.scenic-loading { padding: 12px; background: #12263e; border-radius: 8px; }
.scenic-filter-bar { margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; background: #e8f2fc; color: #112b49; }
.scenic-filter-bar + .card { margin-top: 0; }
.scenic-nav-toggle { display: none; }
.scenic-post { margin-bottom: 8px; }
.scenic-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
#main-content > section[hidden] { display: none; }
.scenic-home :focus-visible, .scenic-active .sidebar :focus-visible, .scenic-gallery :focus-visible, .scenic-nav-toggle:focus-visible {
    outline: 3px solid #ffdb83;
    outline-offset: 3px;
}

.scenic-gallery {
    width: min(670px, calc(100% - 24px));
    max-height: calc(100% - 24px);
    padding: 22px;
    border: 1px solid #6b8aa8;
    border-radius: 17px;
    background: #12253c;
    color: white;
    box-shadow: 0 14px 65px #020913;
}
.scenic-gallery::backdrop { background: rgba(2,10,21,.77); }
.scenic-gallery h2, .scenic-gallery p { margin: 0 0 12px; color: inherit; }
.scenic-gallery h2 { font-size: 1.45rem; }
.scenic-gallery-title, .scenic-gallery-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.scenic-gallery-filters, .scenic-gallery-pages { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.scenic-gallery-pages { align-items: center; justify-content: center; }
.scenic-gallery-pages button:disabled { opacity: .65; cursor: default; }
.scenic-gallery label { color: var(--scenic-ink); }
.scenic-gallery select { display: block; max-width: 100%; min-height: 40px; background: #152e4d; color: white; }
.scenic-gallery-filters label { flex: 1 1 230px; min-width: 0; }
#scenic-current-choice { margin: 12px 0 0; }
.scenic-scene-grid { border: 0; padding: 0; margin: 10px 0; min-inline-size: 0; }
#scenic-choices { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.scenic-scene {
    display: grid;
    grid-template-columns: auto minmax(0,1fr);
    align-content: start;
    align-items: center;
    gap: 6px;
    padding: 7px;
    border: 1px solid #6e8baa;
    border-radius: 10px;
    cursor: pointer;
}
.scenic-scene:has(input:checked) { border-color: #bde3ff; background: #254467; }
.scenic-scene input { width: auto; margin: 0; }
.scenic-thumb { grid-column: 1 / -1; grid-row: 1; height: 62px; border-radius: 5px; background-color: #0a192e; overflow: hidden; }
.scenic-thumb img { width: 100%; height: 100%; object-fit: cover; }
.scenic-scene > span:last-child { grid-column: 2; font-size: .85rem; overflow-wrap: anywhere; }
.scenic-check { color: white; display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.scenic-check input { width: auto; }
.scenic-preferences { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 14px; margin-block: 14px 8px; }
.scenic-preferences input[type="range"] { display: block; padding: 0; accent-color: #a4d5ff; }
.scenic-preferences output { font-weight: 750; }
.scenic-gallery-footer { flex-wrap: wrap; }
#scenic-gallery-status:empty { display: none; }

.scenic-view {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #081529;
    overflow: hidden;
}
.scenic-view::backdrop { background: #081529; }
.scenic-view-surface { position: absolute; inset: 0; background: #081529; isolation: isolate; }
.scenic-view-surface:fullscreen { width: 100%; height: 100%; }
.scenic-view .scenic-background { inset: 0; height: auto; }
.scenic-view .scenic-background::after { content: none; }
.scenic-view-back { position: absolute; bottom: max(18px,env(safe-area-inset-bottom)); right: max(18px,env(safe-area-inset-right)); }

@media (max-width: 1160px) {
    .scenic-actions { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .scenic-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 900px) {
    .scenic-nav-toggle {
        display: inline-flex;
        align-items: center;
        min-height: 42px;
        padding: 8px 12px;
        border: 1px solid #6e8baa;
        color: #173b60;
        background: #e8f3ff;
    }
    .scenic-nav-toggle::after { content: "▾"; padding-left: .7em; }
    .scenic-nav-toggle[aria-expanded="true"]::after { content: "▴"; }
    .sidebar.scenic-nav-collapsed .nav, .sidebar.scenic-nav-collapsed .scenic-post,
    .sidebar.scenic-nav-collapsed .sidebar-foot { display: none; }
    .sidebar.scenic-nav-collapsed .scenic-global-mobile { display: none; }
    .scenic-active .sidebar.scenic-nav-collapsed {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px 15px;
    }
    .scenic-active .sidebar .nav-label { display: none; }
    .scenic-active .topbar { min-height: 56px; }
    .scenic-active .profile-mode-bar { padding-block: 6px; }
    .scenic-active .layout { grid-template-columns: 1fr; }
    .scenic-active .sidebar { position: static; height: auto; }
    .scenic-active .marketplace-global { flex-wrap: wrap; }
}
@media (max-width: 640px) {
    #scenic-choices { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .scenic-gallery { padding: 14px; }
    .scenic-gallery-filters label { flex-basis: 100%; }
    .scenic-home { padding: 13px; }
    .scenic-hero { padding: 14px 0 18px; }
    .scenic-grid { grid-template-columns: 1fr; }
    .scenic-actions { gap: 7px; }
    .scenic-action { min-height: 78px; padding: 8px 6px; font-size: .8rem; }
    .scenic-active .topbar { flex-wrap: wrap; gap: 8px; }
    .scenic-active .profile-switch { max-width: 100%; flex-wrap: wrap; }
    .scenic-active .profile-switch select { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .scenic-moving img, .scenic-action-motion img, .scenic-welcome { animation: none; }
}

@media (forced-colors: active) {
    .scenic-background { display: none; }
}

/* Page headings sit directly over the scene. Form cards retain their existing colors. */
.scenic-glass-on:not(.scenic-active) #main-content > .section-title {
    color: var(--scenic-ink);
    text-shadow: 0 1px 3px #050d19, 0 0 5px #050d19, 0 0 9px #050d19;
}
.scenic-glass-on:not(.scenic-active) #main-content > .section-title :is(h1, p) {
    color: inherit;
}
.scenic-glass-on .topbar .btn.text { color: var(--scenic-ink); }
.scenic-glass-on .sidebar .nav button:not(.active, :hover),
.scenic-glass-on .topbar .btn.text {
    text-shadow: 0 1px 3px #050d19, 0 0 5px #050d19, 0 0 9px #050d19;
}
