/* Named and Unnamed Spaces: moodboard canvas styles */

.blog-content:has(#nvuViewport) {
    padding: 24px 18px 14px;
}

.nvu-intro {
    max-width: 760px;
    opacity: 0.85;
}

/* ---- viewport & world ------------------------------------------------ */
#nvuViewport {
    position: relative;
    height: calc(100vh - 230px);
    min-height: 480px;
    border: 1px solid var(--accentTransparent);
    border-radius: 12px;
    overflow: hidden;
    touch-action: none;
    cursor: grab;
    background:
        radial-gradient(ellipse at 30% 20%, var(--accentVeryTransparent), transparent 60%),
        var(--backgroundColor);
    outline: none;
    user-select: none;
    -webkit-user-select: none;
}
#nvuViewport:active { cursor: grabbing; }
#nvuViewport:fullscreen { height: 100vh; border-radius: 0; }

#nvuWorld {
    position: absolute;
    top: 0; left: 0;
    transform-origin: 0 0;
}

/* Screen-sized dot grid; app.js moves it via background-position/-size so it
   pans and zooms with the world without painting a huge layer. */
#nvuGrid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(var(--accentVeryTransparent) 1.5px, transparent 1.5px);
    background-size: 44px 44px;
}

/* ---- cluster captions ------------------------------------------------ */
.nvu-cluster {
    position: absolute;
    transform: translateX(-50%);
    z-index: 0;
    pointer-events: none;
    font-size: 54px;
    font-weight: 800;
    letter-spacing: 0.06em;
    white-space: nowrap;
    color: color-mix(in srgb, var(--textColor) 13%, transparent);
    text-transform: lowercase;
}

/* ---- cards ----------------------------------------------------------- */
.nvu-card {
    position: absolute;
    z-index: 1;
    width: 250px;
    border-radius: 10px;
    background: var(--dark-transparent);
    border: 1px solid color-mix(in srgb, var(--textColor) 16%, transparent);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    cursor: pointer;
    transform: rotate(var(--tilt, 0deg));
    transform-origin: top left;
    transition: box-shadow 0.25s, border-color 0.25s, width 0.25s ease, transform 0.25s ease;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.nvu-card:hover {
    border-color: var(--accentTransparent);
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5), 0 0 18px var(--accentVeryTransparent);
}
.nvu-card.is-named { border-top: 3px solid var(--accentColor); }
.nvu-card.is-unnamed { border-style: dashed; border-top-width: 3px; }

/* Zoomed-out level of detail (world gets .nvu-far below FAR_Z in app.js).
   The frosted blur is the single most expensive effect on mobile, and every
   card re-blurs its backdrop each frame while panning. At small scale the
   blur and drop shadow are imperceptible, so drop them here; they return the
   moment you zoom back in. Open cards are always read up close, so keep theirs. */
.nvu-far .nvu-card:not(.open) {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    transition: none;
}

.nvu-thumb {
    position: relative;
    height: 132px;
    background: linear-gradient(135deg, var(--accentVeryTransparent), transparent 70%);
}
.nvu-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.nvu-thumb.nvu-noimg img { display: none; }
.nvu-year {
    position: absolute;
    top: 7px; right: 7px;
    padding: 1px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.72);
    border: 1px solid var(--accentTransparent);
    color: #fff;
    font-size: 12px;
    letter-spacing: 0.05em;
}

.nvu-meta { padding: 10px 12px 11px; }
.nvu-meta h3 {
    margin: 0;
    font-size: 14px;
    line-height: 1.3;
}
.nvu-area {
    margin-top: 3px;
    font-size: 12.5px;
    color: var(--accentColor);
}
.is-unnamed .nvu-area { color: color-mix(in srgb, var(--textColor) 65%, transparent); }
.nvu-area i { opacity: 0.65; font-size: 11px; }

/* ---- opened card ----------------------------------------------------- */
.nvu-card.open {
    width: 430px;
    z-index: 60;
    cursor: default;
    transform: rotate(0deg); /* straighten the scatter tilt while reading */
    border-color: var(--accentTransparent);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65), 0 0 34px var(--accentVeryTransparent);
}
.nvu-card.open .nvu-thumb { height: 150px; }

/* Engaged card: stays open while its media plays, so mark it as held. */
.nvu-card.open.pinned {
    border-color: var(--accentColor);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65),
                0 0 0 2px var(--accentVeryTransparent),
                0 0 40px var(--accentTransparent);
}

.nvu-detail { display: none; }
.nvu-card.open .nvu-detail {
    display: block;
    padding: 0 12px 12px;
}

.nvu-video {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    cursor: pointer;
    margin-bottom: 8px;
}
.nvu-video img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.85; }
.nvu-video iframe { width: 100%; height: 100%; border: 0; display: block; }
.nvu-play {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 48px; height: 48px;
    border-radius: 50%;
    border: 1px solid var(--accentColor);
    background: rgba(0, 0, 0, 0.65);
    color: var(--accentColor);
    cursor: pointer;
    transition: transform 0.2s;
}
/* Solid, thick play triangle drawn in CSS, matching the theme player toggle,
   scaled up for the 48px overlay button. */
.nvu-play::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 0; height: 0;
    border-style: solid;
    border-width: 11px 0 11px 18px;
    border-color: transparent transparent transparent currentColor;
    margin-left: 3px;          /* nudge right so it reads optically centered */
}
.nvu-video:hover .nvu-play { transform: translate(-50%, -50%) scale(1.12); }

.nvu-screens {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}
.nvu-screens img {
    flex: 1 1 0;
    min-width: 0;
    height: 74px;
    object-fit: cover;
    border-radius: 6px;
    cursor: zoom-in;
    border: 1px solid color-mix(in srgb, var(--textColor) 12%, transparent);
}

/* Area theme, styled as a compact audio player. The real YouTube player is
   hidden off screen in .nvu-ost-player and driven through the IFrame API. */
.nvu-ost {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--textColor) 5%, transparent);
    border: 1px solid color-mix(in srgb, var(--textColor) 10%, transparent);
}
.nvu-ost-toggle {
    position: relative;
    flex: 0 0 34px;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid var(--accentColor);
    background: transparent;
    color: var(--accentColor);
    cursor: pointer;
    transition: background 0.2s ease;
}
.nvu-ost-toggle:hover,
.nvu-ost-toggle.on { background: var(--accentVeryTransparent); }

/* Icon drawn in CSS, not a font glyph, so the play shape is a solid, thick
   triangle. Paused (default) shows the triangle; playing (.on) shows two bars.
   currentColor is the accent, inherited from the button. */
.nvu-ost-toggle::before,
.nvu-ost-toggle::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}
/* Play triangle */
.nvu-ost-toggle::before {
    width: 0; height: 0;
    border-style: solid;
    border-width: 8px 0 8px 13px;
    border-color: transparent transparent transparent currentColor;
    margin-left: 2px;          /* nudge right so it reads optically centered */
}
.nvu-ost-toggle::after { display: none; }
/* Pause: two bars replace the triangle */
.nvu-ost-toggle.on::before,
.nvu-ost-toggle.on::after {
    display: block;
    width: 3.5px; height: 13px;
    border: 0;
    margin: 0;
    border-radius: 1px;
    background: currentColor;
}
.nvu-ost-toggle.on::before { transform: translate(-50%, -50%) translateX(-4px); }
.nvu-ost-toggle.on::after  { transform: translate(-50%, -50%) translateX(4px); }
.nvu-ost-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.nvu-ost-title {
    font-size: 12.5px;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nvu-ost-title a { color: var(--accentColor); }
.nvu-ost-bar {
    position: relative;
    height: 5px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--textColor) 16%, transparent);
    cursor: pointer;
}
.nvu-ost-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 0%;
    border-radius: 3px;
    background: var(--accentColor);
}
.nvu-ost-time {
    flex: 0 0 auto;
    font-size: 11px;
    opacity: 0.7;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
/* Volume: speaker icon plus a slim native range, styled to the accent. */
.nvu-ost-vol {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--accentColor);
}
.nvu-ost-vol-ico {
    flex: 0 0 15px;
    width: 15px; height: 15px;
    fill: currentColor;
    opacity: 0.85;
}
.nvu-ost-vol-range {
    -webkit-appearance: none;
    appearance: none;
    width: 54px;
    height: 5px;
    margin: 0;
    border-radius: 3px;
    background: color-mix(in srgb, var(--textColor) 16%, transparent);
    cursor: pointer;
}
.nvu-ost-vol-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 11px; height: 11px;
    border: 0;
    border-radius: 50%;
    background: var(--accentColor);
    cursor: pointer;
}
.nvu-ost-vol-range::-moz-range-thumb {
    width: 11px; height: 11px;
    border: 0;
    border-radius: 50%;
    background: var(--accentColor);
    cursor: pointer;
}
.nvu-ost-vol-range:focus-visible {
    outline: 2px solid var(--accentColor);
    outline-offset: 2px;
}
/* The driving player is present but never seen or interacted with. */
.nvu-ost-player {
    position: absolute;
    left: -9999px;
    top: 0;
    width: 320px;
    height: 180px;
    overflow: hidden;
    pointer-events: none;
}

.nvu-notes {
    margin: 6px 0 0;
    font-size: 12.5px;
    opacity: 0.8;
}
.nvu-vibe { margin-top: 8px; }
.nvu-vibe span {
    display: inline-block;
    margin: 0 4px 4px 0;
    padding: 2px 9px;
    font-size: 11px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--textColor) 22%, transparent);
    opacity: 0.75;
}

/* ---- toolbar --------------------------------------------------------- */
.nvu-toolbar {
    position: absolute;
    top: 10px; left: 10px; right: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    pointer-events: none;
    z-index: 80;
}
.nvu-toolbar > * { pointer-events: auto; }
.nvu-tools { display: flex; gap: 6px; align-items: center; }

.nvu-btn {
    width: 34px; height: 34px;
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--textColor) 22%, transparent);
    background: var(--dark-transparent);
    color: var(--textColor);
    font-size: 16px;
    cursor: pointer;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.nvu-btn:hover { border-color: var(--accentColor); color: var(--accentColor); }

#nvuSearch {
    height: 34px;
    width: 200px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--textColor) 22%, transparent);
    background: var(--dark-transparent);
    color: var(--textColor);
    font-size: 13px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
#nvuSearch:focus { outline: none; border-color: var(--accentColor); }

.nvu-legend { display: flex; gap: 6px; }
.nvu-key {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--dark-transparent);
    opacity: 0.9;
}
.nvu-key-named { border: 1px solid var(--accentColor); border-top-width: 3px; }
.nvu-key-unnamed { border: 1px dashed color-mix(in srgb, var(--textColor) 45%, transparent); border-top-width: 3px; }

.nvu-suggest-btn {
    height: 34px;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid var(--accentColor);
    background: var(--dark-transparent);
    color: var(--accentColor);
    font-size: 13px;
    cursor: pointer;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: background 0.2s;
}
.nvu-suggest-btn:hover { background: var(--accentVeryTransparent); }

.nvu-hint {
    position: absolute;
    bottom: 8px; left: 50%;
    transform: translateX(-50%);
    font-size: 11.5px;
    opacity: 0.55;
    pointer-events: none;
    white-space: nowrap;
    z-index: 80;
}

/* ---- modal ----------------------------------------------------------- */
.nvu-modal {
    position: fixed;
    inset: 0;
    z-index: 30000; /* above the arc nav (11000) and its tooltips (20000) */
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.nvu-modal[hidden] { display: none; }
.nvu-modal-card {
    position: relative;
    width: min(92vw, 440px);
    background: var(--dark);
    border: 1px solid var(--accentTransparent);
    border-radius: 12px;
    padding: 24px;
}
.nvu-modal-card h3 { margin: 0 0 6px; }
.nvu-modal-card p { font-size: 13px; opacity: 0.8; margin: 0 0 14px; }
.nvu-modal-card label {
    display: block;
    font-size: 12.5px;
    margin-bottom: 12px;
    opacity: 0.9;
}
.nvu-modal-card input[type="text"],
.nvu-modal-card textarea {
    width: 100%;
    margin-top: 4px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--textColor) 22%, transparent);
    background: var(--darkForOpacity);
    color: var(--textColor);
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
}
.nvu-modal-card input:focus,
.nvu-modal-card textarea:focus { outline: none; border-color: var(--accentColor); }
.nvu-modal-close {
    position: absolute;
    top: 10px; right: 12px;
    background: none;
    border: none;
    color: var(--textColor);
    font-size: 22px;
    cursor: pointer;
    opacity: 0.7;
}
.nvu-modal-close:hover { opacity: 1; }
.nvu-hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }

/* ---- lightbox -------------------------------------------------------- */
.nvu-lightbox {
    position: fixed;
    inset: 0;
    z-index: 30100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.85);
    cursor: zoom-out;
}
.nvu-lightbox[hidden] { display: none; }
.nvu-lightbox img {
    max-width: 92vw;
    max-height: 84vh;
    border-radius: 8px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.8);
}
.nvu-lightbox-src {
    font-size: 12.5px;
    color: var(--accentColor);
    cursor: pointer;
}

/* ---- toast ------------------------------------------------------------ */
.nvu-toast {
    position: fixed;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30200;
    padding: 10px 18px;
    border-radius: 10px;
    background: var(--dark);
    border: 1px solid var(--accentColor);
    color: var(--textColor);
    font-size: 13.5px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.nvu-toast[hidden] { display: none; }

/* ---- light theme tweaks ---------------------------------------------- */
@media (prefers-color-scheme: light) {
    .nvu-card,
    .nvu-btn,
    #nvuSearch,
    .nvu-key,
    .nvu-suggest-btn {
        background: rgba(255, 255, 255, 0.78);
    }
}

/* ---- small screens ---------------------------------------------------- */
@media (max-width: 700px) {
    #nvuViewport { height: 72vh; min-height: 420px; }
    .nvu-toolbar { gap: 6px; }
    #nvuSearch { width: 130px; }
    .nvu-card.open { width: min(430px, 86vw); }
    .nvu-hint { display: none; }
}
