/* =========================================================
   CINEMATIC MEDIA LIBRARY V1
   Local-preview visual engine.
   ========================================================= */

.cml-section{
    padding:78px 0;
    border-bottom:1px solid rgba(255,255,255,.05);
}

.cml-head{
    display:grid;
    grid-template-columns:1fr minmax(300px,.65fr);
    gap:42px;
    align-items:end;
    margin-bottom:18px;
}

.cml-head span{
    color:rgb(var(--world-accent)/.82);
    font:700 .4rem/1 monospace;
    letter-spacing:.09em;
}

.cml-head h2{
    margin:9px 0 0;
    color:#fff;
    font-size:clamp(2rem,3.8vw,4rem);
    line-height:.93;
    letter-spacing:-.055em;
}

.cml-head p{
    margin:0;
    color:var(--ws-muted);
    font-size:.58rem;
    line-height:1.65;
}

.cml-boundary{
    margin-bottom:12px;
    padding:11px 13px;
    border:1px solid rgba(255,172,104,.13);
    border-radius:18px;
    color:rgba(255,218,180,.60);
    background:rgba(255,172,104,.025);
    font:650 .4rem/1.55 monospace;
}

.cml-toolbar{
    display:grid;
    grid-template-columns:minmax(260px,1fr) auto auto;
    gap:8px;
    align-items:center;
    margin-bottom:12px;
}

.cml-search{
    min-height:44px;
    padding:0 14px;
    border:1px solid rgba(255,255,255,.08);
    border-radius:999px;
    outline:0;
    color:#fff;
    background:
        linear-gradient(145deg,rgba(255,255,255,.04),rgba(255,255,255,.01)),
        rgba(7,18,28,.72);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.04);
}

.cml-search::placeholder{color:rgba(255,255,255,.26)}
.cml-search:focus{border-color:rgba(255,114,183,.25)}

.cml-filters,
.cml-modes{
    display:flex;
    gap:6px;
    flex-wrap:wrap;
}

.cml-filter,
.cml-mode{
    min-height:38px;
    padding:0 10px;
    border:1px solid rgba(255,255,255,.065);
    border-radius:999px;
    color:rgba(255,255,255,.38);
    background:rgba(255,255,255,.012);
    cursor:pointer;
    font:700 .35rem/1 monospace;
    letter-spacing:.055em;
}

.cml-filter:hover,
.cml-filter.is-active,
.cml-mode:hover,
.cml-mode.is-active{
    color:#fff;
    border-color:rgba(255,114,183,.22);
    background:
        linear-gradient(135deg,rgba(255,114,183,.06),rgba(91,234,255,.035));
}

.cml-meta{
    min-height:22px;
    display:flex;
    justify-content:space-between;
    gap:12px;
    margin-bottom:10px;
    color:rgba(255,255,255,.27);
    font:650 .36rem/1 monospace;
    letter-spacing:.05em;
}

/* Mosaic */
.cml-stage[data-mode="mosaic"]{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:8px;
}

.cml-card{
    position:relative;
    min-height:245px;
    overflow:hidden;
    border:1px solid rgba(255,255,255,.075);
    border-radius:22px;
    background:#07111a;
    cursor:pointer;
    isolation:isolate;
}

.cml-card:nth-child(7n+1),
.cml-card:nth-child(7n+5){
    grid-column:span 2;
}

.cml-card img{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    display:block;
    object-fit:cover;
    filter:brightness(.82) saturate(1.06);
    transition:
        transform .52s cubic-bezier(.2,.75,.2,1),
        filter .3s ease;
}

.cml-card::after{
    content:"";
    position:absolute;
    inset:0;
    z-index:1;
    pointer-events:none;
    background:
        linear-gradient(180deg,transparent 36%,rgba(4,10,16,.82) 100%),
        radial-gradient(circle at 0 0,rgba(255,114,183,.07),transparent 34%);
}

.cml-card:hover img{
    transform:scale(1.03);
    filter:brightness(.92) saturate(1.10);
}

.cml-card-copy{
    position:absolute;
    z-index:2;
    left:14px;
    right:14px;
    bottom:13px;
}

.cml-card-meta{
    display:flex;
    justify-content:space-between;
    gap:8px;
    align-items:center;
}

.cml-card-meta span,
.cml-card-meta i{
    font:700 .32rem/1 monospace;
    letter-spacing:.05em;
}

.cml-card-meta span{color:rgba(255,114,183,.80)}
.cml-card-meta i{
    padding:5px 7px;
    border:1px solid rgba(255,255,255,.08);
    border-radius:999px;
    color:rgba(255,255,255,.44);
    background:rgba(5,12,18,.56);
    font-style:normal;
}

.cml-card h3{
    margin:8px 0 0;
    color:#fff;
    font-size:.72rem;
    line-height:1.25;
}

/* Story */
.cml-stage[data-mode="story"]{
    display:grid;
    gap:10px;
}

.cml-story{
    min-height:540px;
    display:grid;
    grid-template-columns:minmax(0,1.25fr) minmax(300px,.75fr);
    overflow:hidden;
    border:1px solid rgba(255,255,255,.08);
    border-radius:28px;
    background:
        linear-gradient(145deg,rgba(255,255,255,.04),rgba(255,255,255,.008)),
        rgba(8,19,29,.72);
    box-shadow:0 24px 70px rgba(0,0,0,.18);
}

.cml-story-media{
    position:relative;
    min-height:520px;
    background:#07111a;
}

.cml-story-media img{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    object-fit:cover;
    filter:brightness(.88) saturate(1.05);
}

.cml-story-media::after{
    content:"";
    position:absolute;
    inset:0;
    background:
        linear-gradient(90deg,transparent 55%,rgba(7,17,26,.72) 100%),
        linear-gradient(180deg,transparent 68%,rgba(7,17,26,.48));
}

.cml-story-copy{
    padding:28px 24px;
    align-self:center;
}

.cml-story-copy>span{
    color:rgb(var(--world-accent)/.76);
    font:700 .38rem/1 monospace;
    letter-spacing:.08em;
}

.cml-story-copy h3{
    margin:13px 0 9px;
    color:#fff;
    font-size:1.5rem;
    letter-spacing:-.04em;
}

.cml-story-copy p{
    margin:0;
    color:var(--ws-muted);
    font-size:.56rem;
    line-height:1.68;
}

.cml-story-facts{
    margin-top:18px;
    display:flex;
    gap:6px;
    flex-wrap:wrap;
}

.cml-story-facts span{
    padding:6px 8px;
    border:1px solid rgba(255,255,255,.07);
    border-radius:999px;
    color:rgba(255,255,255,.38);
    background:rgba(255,255,255,.012);
    font:650 .33rem/1 monospace;
}

/* Reel */
.cml-stage[data-mode="reel"]{
    display:flex;
    gap:9px;
    overflow-x:auto;
    padding:2px 1px 12px;
    scroll-snap-type:x mandatory;
    scrollbar-width:thin;
}

.cml-reel-card{
    flex:0 0 min(430px,78vw);
    height:520px;
    position:relative;
    overflow:hidden;
    scroll-snap-align:center;
    border:1px solid rgba(255,255,255,.075);
    border-radius:28px;
    background:#07111a;
    cursor:pointer;
}

.cml-reel-card img{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    object-fit:cover;
    filter:brightness(.82) saturate(1.07);
}

.cml-reel-card::after{
    content:"";
    position:absolute;
    inset:0;
    z-index:1;
    background:linear-gradient(180deg,transparent 42%,rgba(4,10,16,.88) 100%);
}

.cml-reel-copy{
    position:absolute;
    z-index:2;
    left:18px;
    right:18px;
    bottom:18px;
}

.cml-reel-copy span{
    color:rgba(255,114,183,.78);
    font:700 .36rem/1 monospace;
    letter-spacing:.06em;
}

.cml-reel-copy h3{
    margin:9px 0 0;
    color:#fff;
    font-size:1rem;
}

/* Viewer */
.cml-viewer{
    position:fixed;
    inset:0;
    z-index:99940;
    display:grid;
    place-items:center;
    padding:18px;
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    transition:.2s ease;
}

.cml-viewer.is-open{
    opacity:1;
    visibility:visible;
    pointer-events:auto;
}

.cml-viewer-backdrop{
    position:absolute;
    inset:0;
    border:0;
    background:rgba(2,7,11,.86);
    backdrop-filter:blur(34px) saturate(150%);
}

.cml-viewer-panel{
    position:relative;
    z-index:2;
    width:min(1320px,100%);
    max-height:calc(100vh - 36px);
    overflow:hidden;
    display:grid;
    grid-template-rows:auto minmax(0,1fr);
    border:1px solid rgba(255,255,255,.10);
    border-radius:32px;
    background:rgba(8,19,29,.985);
    box-shadow:0 56px 180px rgba(0,0,0,.5);
}

.cml-viewer-head{
    padding:14px 16px;
    display:flex;
    justify-content:space-between;
    gap:14px;
    align-items:center;
    border-bottom:1px solid rgba(255,255,255,.065);
}

.cml-viewer-head span{
    color:rgba(255,114,183,.70);
    font:700 .36rem/1 monospace;
}

.cml-viewer-head h3{
    margin:6px 0 0;
    color:#fff;
    font-size:1rem;
}

.cml-viewer-actions{
    display:flex;
    gap:6px;
}

.cml-viewer-actions button{
    width:40px;
    height:40px;
    border:1px solid rgba(255,255,255,.08);
    border-radius:50%;
    color:#fff;
    background:rgba(255,255,255,.015);
    cursor:pointer;
}

.cml-viewer-grid{
    min-height:0;
    display:grid;
    grid-template-columns:minmax(0,1.35fr) minmax(300px,.65fr);
}

.cml-viewer-media{
    min-height:0;
    display:grid;
    place-items:center;
    overflow:auto;
    background:#060e15;
}

.cml-viewer-media img{
    max-width:100%;
    max-height:78vh;
    display:block;
    object-fit:contain;
}

.cml-viewer-meta{
    padding:20px;
    overflow:auto;
    border-left:1px solid rgba(255,255,255,.06);
}

.cml-viewer-meta p{
    margin:0;
    color:var(--ws-muted);
    font-size:.54rem;
    line-height:1.65;
}

.cml-viewer-facts{
    margin-top:16px;
    display:grid;
    gap:7px;
}

.cml-viewer-fact{
    padding:10px;
    border:1px solid rgba(255,255,255,.065);
    border-radius:14px;
    background:rgba(255,255,255,.012);
}

.cml-viewer-fact span{
    display:block;
    color:var(--ws-dim);
    font:700 .32rem/1 monospace;
}

.cml-viewer-fact strong{
    display:block;
    margin-top:6px;
    color:#fff;
    font-size:.5rem;
    line-height:1.45;
}

@media(max-width:1050px){
    .cml-toolbar{grid-template-columns:1fr}
    .cml-stage[data-mode="mosaic"]{grid-template-columns:repeat(2,minmax(0,1fr))}
    .cml-story{grid-template-columns:1fr}
    .cml-story-media{min-height:420px}
    .cml-viewer-grid{grid-template-columns:1fr}
    .cml-viewer-meta{border-left:0;border-top:1px solid rgba(255,255,255,.06)}
}

@media(max-width:620px){
    .cml-head{grid-template-columns:1fr}
    .cml-stage[data-mode="mosaic"]{grid-template-columns:1fr}
    .cml-card:nth-child(n){grid-column:auto}
    .cml-card{min-height:310px;border-radius:20px}
    .cml-story{border-radius:22px}
    .cml-reel-card{height:460px;border-radius:22px}
    .cml-viewer{padding:6px}
    .cml-viewer-panel{border-radius:22px;max-height:calc(100vh - 12px)}
}

/* V13 — CINEMATIC MEDIA LIBRARY */
.cml-toolbar,.cml-story,.cml-viewer-panel{border-radius:30px!important}
.cml-card,.cml-reel-card{
  position:relative;overflow:hidden;border-radius:26px!important;isolation:isolate;
  transition:transform .22s var(--ws-ease),border-color .22s ease,box-shadow .22s ease;
}
.cml-card::after,.cml-reel-card::after{
  content:"";position:absolute;inset:0;z-index:1;pointer-events:none;opacity:0;border-radius:inherit;
  background:radial-gradient(280px circle at var(--mx,50%) var(--my,50%),rgb(var(--world-accent)/.14),transparent 62%);
  transition:opacity .2s ease;
}
.cml-card:hover::after,.cml-reel-card:hover::after{opacity:1}
.cml-card:hover,.cml-reel-card:hover{transform:translateY(-3px);border-color:rgb(var(--world-accent)/.24);box-shadow:0 22px 58px rgba(0,0,0,.15)}
.cml-search,.cml-mode{border-radius:999px!important}
.cml-viewer-media{background:#061019}
\n.cml-detail-link{display:inline-flex;margin-top:.55rem;padding:.42rem .7rem;border:1px solid rgba(255,255,255,.13);border-radius:999px;color:inherit;text-decoration:none;font-size:.72rem;letter-spacing:.08em}.cml-detail-link:hover,.cml-detail-link:focus-visible{border-color:rgba(var(--world-accent),.55);outline:none}\n