:root {
    --bg: #0a0e1a;
    --bg-card: #131a2e;
    --bg-card-hover: #1a2240;
    --text: #e8edf7;
    --text-secondary: #8a94b0;
    --text-muted: #5a6378;
    --line: rgba(140, 165, 220, 0.12);
    --accent: #4f8cff;
    --accent-deep: #2563eb;
    --accent-glow: #00d4ff;
    --panel: rgba(120, 150, 220, 0.05);
    --panel-strong: rgba(120, 150, 220, 0.08);
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
    --radius-xl: 24px;
    --radius-lg: 20px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

button,
input {
    font: inherit;
}

textarea {
    font: inherit;
}

button {
    border: 0;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 18% -10%, rgba(79, 140, 255, 0.18), transparent 45%),
        radial-gradient(circle at 90% 8%, rgba(0, 212, 255, 0.10), transparent 40%),
        var(--bg);
    background-attachment: fixed;
}

a {
    color: inherit;
    text-decoration: none;
}

.page-shell {
    width: min(1200px, calc(100% - 48px));
    margin: 0 auto;
    padding: 24px 0 80px;
}

/* ── Header ── */

.site-header {
    position: sticky;
    top: 16px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 24px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(10, 14, 26, 0.78);
    backdrop-filter: blur(20px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-mark {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #fff;
    font-weight: 800;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
}

.brand-name {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: color 180ms ease, background 180ms ease;
    cursor: pointer;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text);
}

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 22px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
    transition: transform 180ms ease, box-shadow 180ms ease;
    cursor: pointer;
}

.primary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.4);
    color: #fff;
}

.primary-button.danger {
    color: #fff;
    background: linear-gradient(135deg, #dc2626, #991b1b);
    box-shadow: 0 12px 22px rgba(220, 38, 38, 0.18);
}

.primary-button.danger:hover {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: #fff;
}

.outline-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 22px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    border: 1px solid var(--line);
    background: transparent;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
    cursor: pointer;
}

.outline-button:hover {
    transform: translateY(-1px);
    border-color: rgba(140, 165, 220, 0.3);
    background: rgba(120, 150, 220, 0.08);
}

.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border: 1px solid var(--line);
    background: transparent;
    cursor: pointer;
    transition: color 180ms ease, border-color 180ms ease;
}

.ghost-button:hover {
    color: var(--text);
    border-color: rgba(140, 165, 220, 0.3);
}

.ghost-button.danger {
    color: #fca5a5;
    border-color: rgba(248, 113, 113, 0.32);
}

.ghost-button.danger:hover {
    color: #fff;
    border-color: rgba(248, 113, 113, 0.6);
    background: rgba(248, 113, 113, 0.12);
}

.user-chip {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    min-height: 42px;
    padding: 6px 14px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line);
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1.2;
}

.user-chip small {
    margin-top: 2px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* ── Hero ── */

/* ── Hero ──
   Single full-width stage that combines the backdrop image, a darkening
   gradient mask, and an overlay carrying the title + CTAs. The title and
   buttons sit ON TOP of the image (bottom-aligned), giving the homepage a
   cinematic "showcase" feel and cutting down the wall of intro text that
   used to live above the image. */

.hero {
    margin-top: 36px;
}

.hero-stage {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--bg-card);
    aspect-ratio: 16 / 9;
    transition:
        transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.45s ease,
        border-color 0.45s ease;
    will-change: transform;
}

/* The image layer (data-workspace-gallery target). site.js replaces this
   element's innerHTML, so the mask + overlay must stay OUTSIDE it. */
.hero-image {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.hero-image img,
.hero-image .hero-still {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.6s ease, filter 0.35s ease, opacity 0.7s ease;
}

/* Live viewer iframe layered ON TOP of the static screenshot. While the
   viewer's SOG file is downloading we keep the screenshot visible; once
   the first real frame is on screen the iframe gets `.ready` and fades
   in over the screenshot (which simultaneously gets `.faded`). The iframe
   itself is pointer-events:none so a click on the hero falls through to
   data-workspace-gallery's preview handler — the user still gets the
   full-screen viewer with controls when they click. */
.hero-image .hero-viewer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    opacity: 0;
    /* Snappy cross-fade — once the viewer reports firstFrame we want the
       handoff to feel immediate, not a slow dissolve. */
    transition: opacity 0.25s ease;
    pointer-events: none;
    background: transparent;
}
.hero-image .hero-viewer.ready {
    opacity: 1;
}
.hero-image .hero-still {
    /* Override the longer 0.7s default declared above for the still
       layer, matching the iframe's faster reveal. */
    transition: opacity 0.25s ease;
}
.hero-image .hero-still.faded {
    opacity: 0;
}

/* Soft radial vignette so the title + buttons (which sit in the middle of
   the stage) stay legible regardless of the underlying art. Darker in the
   centre, fading to nearly clear at the edges — preserves the image while
   guaranteeing contrast behind the text. */
.hero-mask {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: radial-gradient(
        ellipse at center,
        rgba(10, 14, 26, 0.6) 0%,
        rgba(10, 14, 26, 0.35) 55%,
        rgba(10, 14, 26, 0.05) 100%
    );
}

/* Overlay: title + CTAs, dead-centered both horizontally and vertically.
   pointer-events: none on the wrapper lets clicks pass through to the
   underlying poster image (whose data-published-preview triggers preview
   open); the buttons re-enable their own pointer events so they still
   receive clicks. */
.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 5vw, 56px) clamp(24px, 5vw, 64px);
    pointer-events: none;
    text-align: center;
}

.hero-overlay h1 {
    /* Smaller fluid size + nowrap to keep the headline on a single line at
       desktop widths. Narrow viewports re-enable wrapping below. */
    margin: 0 auto clamp(20px, 3vw, 32px);
    font-size: clamp(1rem, 3.2vw, 2.6rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: #fff;
    text-shadow: 0 4px 32px rgba(0, 0, 0, 0.55);
    white-space: nowrap;
    max-width: 100%;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    pointer-events: auto;
}

/* Very narrow viewports (phones): let the headline wrap so it doesn't
   shrink to an unreadable size. */
@media (max-width: 480px) {
    .hero-overlay h1 {
        white-space: normal;
        font-size: clamp(1.1rem, 5.5vw, 1.7rem);
    }
}

/* Stage hover effects — only when the underlying poster is actually
   clickable. site.js sets data-published-preview on .hero-image when
   pos=1 is pinned to a published scene; we mirror the cursor/lift cue
   onto the outer stage via :has() so the entire card responds. */
.hero-stage:has(.hero-image[data-published-preview]:not([data-published-preview=""])) {
    cursor: pointer;
}

.hero-stage:has(.hero-image[data-published-preview]:not([data-published-preview=""])):hover {
    transform: translateY(-4px);
    border-color: var(--accent, #4f8cff);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(79, 140, 255, 0.4);
}

.hero-stage:has(.hero-image[data-published-preview]:not([data-published-preview=""])):hover .hero-image img {
    transform: scale(1.03);
    filter: brightness(1.06);
}

/* Responsive: on narrow screens give the hero a bit more vertical room so
   the title doesn't cramp the image. */
@media (max-width: 720px) {
    .hero-stage {
        aspect-ratio: 4 / 5;
    }
    .hero-overlay h1 {
        font-size: clamp(1.8rem, 7vw, 2.6rem);
    }
}

/* ── Features ── */

.features-section {
    margin-top: 100px;
    text-align: center;
}

.section-title {
    margin: 0 0 16px;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.section-subtitle {
    margin: 0 auto 48px;
    max-width: 580px;
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-card {
    padding: 32px 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--bg-card);
    text-align: left;
    transition: border-color 220ms ease, background 220ms ease;
}

.feature-card:hover {
    border-color: rgba(79, 140, 255, 0.3);
    background: var(--bg-card-hover);
    box-shadow: 0 12px 36px rgba(37, 99, 235, 0.12);
}

.feature-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    margin-bottom: 20px;
    background: rgba(79, 140, 255, 0.14);
    color: var(--accent);
}

.feature-card h3 {
    margin: 0 0 10px;
    font-size: 1.15rem;
    font-weight: 600;
}

.feature-card p {
    margin: 0;
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* ── Capabilities ── */

.capabilities-section {
    margin-top: 100px;
}

.capabilities-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.capabilities-info h2 {
    margin: 0 0 32px;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.capabilities-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 24px;
}

.capabilities-list li {
    display: grid;
    gap: 6px;
    padding-left: 20px;
    border-left: 2px solid var(--accent);
}

.capabilities-list li strong {
    font-size: 1.05rem;
    font-weight: 600;
}

.capabilities-list li span {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.capabilities-visual {
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--bg-card);
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
    will-change: transform;
}

.capabilities-visual img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    aspect-ratio: 4 / 3;
    transition: transform 0.6s ease, filter 0.35s ease;
}

.capabilities-visual[style*="cursor: pointer"]:hover,
.capabilities-visual[data-published-preview]:hover {
    transform: translateY(-4px);
    border-color: var(--accent, #4f8cff);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(79, 140, 255, 0.45);
}

.capabilities-visual[style*="cursor: pointer"]:hover img,
.capabilities-visual[data-published-preview]:hover img {
    transform: scale(1.04);
    filter: brightness(1.05);
}

/* ── Featured Scenes ── */

.scenes-section {
    margin-top: 100px;
    text-align: center;
}

.scenes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.scene-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--bg-card);
    transition: border-color 220ms ease, transform 220ms ease;
}

/* Pointer cursor only when the card actually links to a previewable scene.
   createSceneCard always sets data-published-preview (sometimes to ''), so
   we exclude the empty case explicitly. */
.scene-card[data-published-preview]:not([data-published-preview=""]) {
    cursor: pointer;
}

.scene-card:hover {
    border-color: rgba(79, 140, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(37, 99, 235, 0.18);
}

.scene-thumb {
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.scene-thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 280ms ease;
}

.scene-card:hover .scene-thumb img {
    transform: scale(1.04);
}

.scene-info {
    padding: 16px 20px;
    text-align: left;
}

.scene-info h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.scene-info p {
    margin: 4px 0 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.scenes-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    padding: 48px 0;
}

.scenes-action {
    margin-top: 36px;
}

/* ── Hidden utility ── */

.hidden-gallery {
    display: none;
}

/* ── Admin workspace landing ── */

.admin-workspace-grid {
    margin-top: 36px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.admin-workspace-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.poster-picker-panel {
    margin-top: 28px;
}

.poster-picker-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 6px;
}

.poster-picker-grid select {
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(120, 150, 220, 0.06);
    color: var(--text);
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a94b0' stroke-width='2'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.poster-picker-grid select:focus {
    border-color: rgba(79, 140, 255, 0.45);
    box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.18);
}

.poster-picker-grid select option {
    background: #131a2e;
    color: #e8edf7;
}

@media (max-width: 700px) {
    .poster-picker-grid {
        grid-template-columns: 1fr;
    }
}

.admin-workspace-card {
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 18px;
    padding: 28px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--line);
    background: var(--bg-card);
    color: inherit;
    text-decoration: none;
    transition: border-color 220ms ease, transform 220ms ease, box-shadow 220ms ease;
}

.admin-workspace-card:hover,
.admin-workspace-card:focus-visible {
    border-color: rgba(79, 140, 255, 0.45);
    transform: translateY(-2px);
    box-shadow: 0 18px 44px rgba(37, 99, 235, 0.22);
    outline: none;
}

.admin-workspace-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.32);
}

.admin-workspace-body {
    display: grid;
    gap: 8px;
}

.admin-workspace-body h3 {
    margin: 0;
    font-size: 1.18rem;
}

.admin-workspace-body .helper-copy {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.admin-workspace-body code {
    font-size: 0.86em;
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(120, 150, 220, 0.12);
}

.admin-workspace-arrow {
    justify-self: end;
    font-size: 1.3rem;
    color: var(--accent);
    transition: transform 220ms ease;
}

.admin-workspace-card:hover .admin-workspace-arrow {
    transform: translateX(4px);
}

.admin-breadcrumb {
    margin-top: 24px;
    margin-bottom: 8px;
}

.admin-breadcrumb .ghost-button {
    min-height: 36px;
    padding: 0 16px;
    font-size: 0.86rem;
}

@media (max-width: 1024px) {
    .admin-workspace-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Danger zone + confirm modal ── */

.danger-card {
    margin-top: 28px;
    border-color: rgba(248, 113, 113, 0.28);
    background:
        linear-gradient(180deg, rgba(248, 113, 113, 0.08), rgba(120, 150, 220, 0.04)),
        var(--bg-card);
}

.section-label.danger {
    color: #f87171;
}

.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 24px;
}

.confirm-modal[hidden] {
    display: none;
}

.confirm-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
}

.confirm-modal-dialog {
    position: relative;
    width: min(480px, 100%);
    border: 1px solid rgba(248, 113, 113, 0.32);
    border-radius: var(--radius-xl);
    background: var(--bg-card);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.confirm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
}

.confirm-modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #fca5a5;
}

.confirm-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease;
}

.confirm-modal-close:hover {
    background: rgba(140, 165, 220, 0.1);
    color: var(--text);
}

.confirm-modal-body {
    padding: 20px 24px;
    display: grid;
    gap: 14px;
    color: var(--text-secondary);
}

.confirm-modal-body p {
    margin: 0;
    line-height: 1.65;
}

.confirm-modal-body strong {
    color: var(--text);
    word-break: break-all;
}

.confirm-modal-body .form-field input {
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(120, 150, 220, 0.06);
    color: var(--text);
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.confirm-modal-body .form-field input:focus {
    border-color: rgba(248, 113, 113, 0.45);
    box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.12);
}

.confirm-modal-body .notice {
    margin: 0;
}

.confirm-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--line);
    background: rgba(120, 150, 220, 0.04);
}

/* ── Shared classes used by site.js and other pages ── */

h2 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 2rem;
    line-height: 1.18;
}

h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.18rem;
}

p,
ul {
    margin-top: 0;
}

.section-label {
    margin: 0 0 12px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.notice {
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.95rem;
}

.notice.error {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.18);
    background: rgba(248, 113, 113, 0.08);
}

.notice.success {
    color: var(--accent);
    border-color: rgba(79, 140, 255, 0.28);
    background: rgba(79, 140, 255, 0.1);
}

/* ── Auth page styles (login.html) ── */

.content-grid {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.content-card {
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--panel);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.content-card p {
    color: var(--text-secondary);
    line-height: 1.8;
}

.content-card.wide {
    grid-column: 1 / -1;
}

.hero-card {
    position: relative;
    overflow: hidden;
    min-height: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background:
        linear-gradient(180deg, rgba(37, 99, 235, 0.4), rgba(0, 0, 0, 0.9)),
        url("./cloud-editor/static/images/header.webp") center / cover;
}

.glass-panel {
    position: absolute;
    inset: auto 24px 24px 24px;
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    backdrop-filter: blur(12px);
}

.panel-label {
    margin: 0 0 12px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

.route-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.route-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.route-list li:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.route-list span {
    color: rgba(255, 255, 255, 0.5);
}

.text-link {
    color: var(--accent);
    font-weight: 700;
}

.text-link:hover {
    text-decoration: underline;
}

.text-note {
    color: var(--text-muted);
    font-size: 0.94rem;
}

.doc-list {
    padding: 0;
    margin: 18px 0 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.explore-grid {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.explore-item {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--panel-strong);
}

.explore-item p {
    color: var(--text-secondary);
    line-height: 1.8;
}

.explore-kicker {
    margin: 0 0 12px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* ── Auth page ── */

.auth-page-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

.auth-card {
    display: grid;
    gap: 18px;
}

.auth-tabs {
    display: inline-flex;
    gap: 10px;
    padding: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
}

.tab-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    color: var(--text-secondary);
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: color 180ms ease, background 180ms ease;
}

.tab-button:hover {
    color: var(--text);
}

.tab-button.active {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
}

.auth-panel.hidden {
    display: none;
}

.form-grid {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

.form-field {
    display: grid;
    gap: 8px;
}

.form-field span {
    font-size: 0.92rem;
    font-weight: 700;
}

.form-field input {
    width: 100%;
    min-height: 50px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.form-field textarea {
    width: 100%;
    min-height: 120px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    outline: none;
    resize: vertical;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.form-field input:focus,
.form-field textarea:focus {
    border-color: rgba(79, 140, 255, 0.45);
    box-shadow: 0 0 0 4px rgba(79, 140, 255, 0.1);
}

.verification-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.verification-row input {
    flex: 1;
    min-width: 0;
}

.verification-row button {
    white-space: nowrap;
    min-height: 50px;
    padding: 0 18px;
}

.verification-row button[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.captcha-field > span {
    display: block;
    margin-bottom: 8px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.captcha-widget {
    display: block;
    user-select: none;
}

.captcha-slider-track {
    position: relative;
    width: 100%;
    height: 46px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(120, 150, 220, 0.08);
    overflow: hidden;
    touch-action: none;
}

.captcha-slider-fill {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 44px;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    transition: background 220ms ease;
    pointer-events: none;
}

.captcha-slider-text {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 0.92rem;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    pointer-events: none;
    z-index: 1;
}

.captcha-slider-handle {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 999px;
    border: 0;
    background: #ffffff;
    color: #2563eb;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
    display: grid;
    place-items: center;
    cursor: grab;
    touch-action: none;
    z-index: 2;
    transition: box-shadow 160ms ease;
}

.captcha-slider-handle:hover {
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.45);
}

.captcha-slider-handle:active {
    cursor: grabbing;
}

.captcha-slider.solved .captcha-slider-fill {
    background: linear-gradient(135deg, #4ade80, #16a34a);
    width: 100% !important;
}

.captcha-slider.solved .captcha-slider-text {
    color: #ffffff;
    font-weight: 600;
}

.captcha-slider.solved .captcha-slider-handle {
    color: #16a34a;
    cursor: default;
    pointer-events: none;
}

.captcha-slider.loading .captcha-slider-text {
    color: var(--text);
}

.captcha-slider.error .captcha-slider-fill {
    background: linear-gradient(135deg, #f87171, #dc2626);
    animation: captcha-shake 320ms ease;
}

.captcha-slider.error .captcha-slider-text {
    color: #fca5a5;
}

@keyframes captcha-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(-2px); }
}

.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.account-summary {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--panel-strong);
    color: var(--text-secondary);
}

.account-summary strong {
    color: var(--text);
    font-size: 1.05rem;
}

.mini-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

/* ── Admin page styles ── */

.admin-hero-card {
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.9)),
        url("./cloud-editor/static/images/screenshot-wide.jpg") center / cover;
}

.admin-locked {
    margin-top: 22px;
}

.admin-import-layout {
    margin-top: 22px;
    grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
}

.admin-import-single {
    margin-top: 28px;
}

.admin-page-head {
    margin-top: 48px;
    margin-bottom: 8px;
    text-align: center;
}

.admin-page-head h1 {
    margin: 0 0 14px;
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.admin-page-sub {
    margin: 0 auto;
    max-width: 560px;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
}

.admin-page-head .section-label {
    margin-bottom: 14px;
    color: var(--accent);
}

.admin-page-head + .notice:not([hidden]) {
    margin-top: 24px;
}

[data-admin-private] > section + section,
[data-admin-private] > section.admin-import-single + section.content-card {
    margin-top: 36px;
}

.admin-stats-grid {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
}

.stat-card,
.metric-card {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel-strong);
}

.stat-card {
    display: grid;
    gap: 10px;
}

.stat-kicker,
.metric-label,
.admin-mini-title {
    margin: 0;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.stat-value {
    font-size: clamp(1.7rem, 3vw, 2.5rem);
    line-height: 1;
}

.stat-note,
.metric-card span,
.table-primary span,
.table-primary small {
    color: var(--text-muted);
}

.admin-layout {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.admin-panel {
    display: grid;
    gap: 18px;
}

.admin-import-single .admin-panel {
    gap: 22px;
    padding: 32px;
}

.admin-import-single .form-grid {
    gap: 18px;
    margin-top: 4px;
}

.admin-import-single .form-actions {
    margin-top: 6px;
}

.admin-files-panel {
    padding: 28px;
}

.admin-files-panel .admin-panel-header {
    margin-bottom: 20px;
}

.admin-files-panel .table-shell {
    background: rgba(255, 255, 255, 0.015);
}

.admin-files-panel .admin-table th {
    font-size: 0.74rem;
    letter-spacing: 0.1em;
}

.admin-files-panel .admin-table th,
.admin-files-panel .admin-table td {
    padding: 16px 18px;
}

.admin-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.admin-subgrid,
.admin-activity-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.metric-card {
    display: grid;
    gap: 8px;
}

.metric-card strong {
    font-size: 1.18rem;
}

.selected-file-shell {
    display: grid;
    gap: 18px;
}

.file-picker-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.file-picker {
    display: grid;
    gap: 12px;
    padding: 22px 22px;
    border: 1.5px dashed rgba(79, 140, 255, 0.36);
    border-radius: 16px;
    background: rgba(79, 140, 255, 0.07);
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.file-picker:hover {
    border-color: rgba(79, 140, 255, 0.6);
    background: rgba(79, 140, 255, 0.1);
}

.file-picker-trigger {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 8px 14px;
    border-radius: 999px;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
}

.file-picker-title {
    font-size: 1.04rem;
    line-height: 1.35;
}

.file-picker-meta {
    color: var(--text-muted);
    line-height: 1.65;
}

.selected-file-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.selected-file-stat {
    display: grid;
    gap: 6px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--panel-strong);
}

.selected-file-stat strong {
    font-size: 1rem;
}

.selected-file-code {
    display: grid;
    gap: 8px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
}

.selected-file-code code {
    white-space: pre-wrap;
    word-break: break-all;
}

.upload-progress {
    display: grid;
    gap: 10px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
}

.upload-progress-track {
    overflow: hidden;
    height: 12px;
    border-radius: 999px;
    background: rgba(79, 140, 255, 0.1);
}

.upload-progress-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    transition: width 160ms ease;
}

.upload-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-muted);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.82rem;
    font-weight: 700;
}

.status-pill.active,
.status-pill.ok {
    color: var(--accent);
    border-color: rgba(79, 140, 255, 0.28);
    background: rgba(79, 140, 255, 0.14);
}

.status-pill.disabled,
.status-pill.warn {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.16);
    background: rgba(248, 113, 113, 0.08);
}

.admin-list {
    display: grid;
    gap: 12px;
}

.admin-list-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--panel-strong);
}

.admin-list-item div {
    display: grid;
    gap: 6px;
}

.admin-list-item strong {
    font-size: 1rem;
}

.admin-list-item small {
    color: var(--text-muted);
}

.admin-search-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-search {
    min-width: min(320px, 100%);
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.admin-search:focus {
    border-color: rgba(79, 140, 255, 0.45);
    box-shadow: 0 0 0 4px rgba(79, 140, 255, 0.1);
}

.table-shell {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.02);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 920px;
}

.admin-table th,
.admin-table td {
    padding: 18px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.admin-table th {
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
}

.admin-table tr:last-child td {
    border-bottom: 0;
}

/* Thumbnail column: small 16:9 cover image (or a faded placeholder for
   unpublished files without a cover yet). The cell + image are both
   bounded by `width` so that long file names elsewhere can't stretch
   the column. vertical-align: middle overrides the table-wide `top` so
   the thumbnail floats in the middle of the row even when the File
   column below it is tall (name + filename + description). */
/* Need to out-specify `.admin-table td { vertical-align: top }` defined
   higher up — otherwise the thumbnail clings to the top of a tall row.
   The cell width is sized for a 44×44 thumb + the same horizontal
   padding the other columns use, so spacing reads consistent across
   the row. */
.admin-table th.admin-table-thumb-col,
.admin-table td.admin-table-thumb-cell {
    width: 76px;
    max-width: 76px;
    vertical-align: middle;
}

.admin-table-thumb {
    width: 44px;
    height: 44px;
    max-width: 44px;
    max-height: 44px;
    border-radius: 6px;
    object-fit: cover;
    display: block;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
}

.admin-table-thumb-placeholder {
    display: grid;
    place-items: center;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.admin-table tr.active-row td {
    background: rgba(79, 140, 255, 0.1);
}

.table-primary {
    display: grid;
    gap: 6px;
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.action-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 38px;
}

.action-menu-button {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: transform 180ms ease, border-color 180ms ease;
}

.action-menu-button:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.2);
}

.action-menu-dot {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: var(--text);
    box-shadow: 0 -7px 0 var(--text), 0 7px 0 var(--text);
}

.action-menu-list {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 160px;
    padding: 8px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(19, 26, 46, 0.96);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
    display: grid;
    gap: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
    z-index: 30;
}

.action-menu[data-open="true"] .action-menu-list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.action-menu-list button {
    border: 0;
    background: transparent;
    text-align: left;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text);
    transition: background 160ms ease;
    width: 100%;
}

.action-menu-list button:hover {
    background: rgba(79, 140, 255, 0.14);
}

.action-menu-list button.danger {
    color: #f87171;
}

.action-menu-list button.danger:hover {
    background: rgba(248, 113, 113, 0.12);
}

.mini-button {
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid transparent;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    cursor: pointer;
    transition: transform 180ms ease;
}

.mini-button.secondary {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--line);
}

.mini-button.danger {
    color: #fff;
    border-color: rgba(248, 113, 113, 0.18);
    background: linear-gradient(135deg, #dc2626, #991b1b);
}

.mini-button:hover {
    transform: translateY(-1px);
}

.empty-state,
.empty-row {
    color: var(--text-muted);
    text-align: center;
}

.empty-row {
    padding: 28px 16px;
}

.meta-pill {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.92rem;
    color: var(--text-muted);
}

/* ── Splat viewer (admin) ── */

.splat-layout {
    margin-top: 22px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
}

.splat-panel {
    display: grid;
    gap: 18px;
}

.splat-preview {
    position: relative;
    min-height: 260px;
    border-radius: 24px;
    border: 1px dashed rgba(79, 140, 255, 0.32);
    background: rgba(79, 140, 255, 0.06);
    display: grid;
    place-items: center;
    overflow: hidden;
}

.splat-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.splat-preview .empty-state {
    padding: 0 24px;
    text-align: center;
}

.splat-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.splat-meta-card {
    display: grid;
    gap: 6px;
    padding: 16px 18px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--panel-strong);
}

.splat-meta-card strong {
    font-size: 1rem;
}

.splat-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.splat-viewer {
    position: relative;
    min-height: 320px;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: var(--bg-card);
    overflow: hidden;
}

.splat-viewer iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #000;
}

.splat-viewer .empty-state {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 0 20px;
    color: var(--text-muted);
    text-align: center;
    background: rgba(0, 0, 0, 0.6);
}

.splat-single {
    margin-top: 32px;
}

.splat-status-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.splat-single > .content-card {
    padding: 32px;
}

.splat-publish-row {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.splat-publish-row h3 {
    margin-bottom: 6px;
}

/* ── Workspace card styles (kept for JS dynamic rendering) ── */

.workspace-card {
    position: relative;
    overflow: hidden;
    min-height: 224px;
    border-radius: 28px;
    background: var(--bg-card);
}

.workspace-card[role="button"] {
    cursor: pointer;
}

.workspace-card[role="button"]:focus {
    outline: 3px solid rgba(79, 140, 255, 0.4);
    outline-offset: 3px;
}

.workspace-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.02) 24%, rgba(0, 0, 0, 0.2) 56%, rgba(0, 0, 0, 0.78) 100%);
}

.workspace-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 220ms ease;
}

.workspace-card:hover img {
    transform: scale(1.04);
}

.workspace-overlay {
    position: absolute;
    inset: auto 18px 18px 18px;
    z-index: 1;
    color: #fff;
}

.workspace-overlay h3 {
    margin-bottom: 8px;
    font-size: 1.32rem;
}

.workspace-overlay p {
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.84);
    line-height: 1.7;
}

.workspace-pill {
    display: inline-flex;
    align-items: center;
    margin-bottom: 14px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.14);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.workspace-gallery {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 18px;
}

.card-feature {
    min-height: 496px;
    grid-row: span 2;
}

.card-feature img {
    object-position: center top;
}

.card-wide {
    min-height: 244px;
    grid-column: 1 / -1;
}

.card-wide img {
    object-position: center 56%;
}

/* ── Gallery tile styles (kept for JS dynamic rendering) ── */

.gallery-tile {
    position: relative;
    overflow: hidden;
    min-height: 132px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 4px;
    border-radius: 18px;
    border: 0;
    text-align: left;
    background-color: transparent;
    background-size: cover;
    background-position: center;
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
    transition: transform 180ms ease;
    cursor: pointer;
}

.gallery-tile:hover {
    transform: translateY(-2px);
}

.gallery-tile strong {
    font-size: 1rem;
    line-height: 1.1;
}

.gallery-tile span {
    font-size: 0.76rem;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.82);
}

.gallery-tile > * {
    position: relative;
    z-index: 1;
}

.tile-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.92);
}

.tile-a {
    background-image: linear-gradient(135deg, rgba(15, 32, 80, 0.96), rgba(79, 140, 255, 0.78));
}

.tile-b {
    background-image: linear-gradient(135deg, rgba(28, 52, 92, 0.96), rgba(46, 90, 146, 0.9));
}

.tile-c {
    background-image: linear-gradient(135deg, rgba(97, 52, 115, 0.96), rgba(151, 78, 111, 0.88));
}

.tile-d {
    background-image: linear-gradient(135deg, rgba(149, 94, 40, 0.95), rgba(204, 143, 66, 0.9));
}

/* ── Responsive ── */

@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: 1fr;
    }

    .capabilities-grid {
        grid-template-columns: 1fr;
    }

    .scenes-grid {
        grid-template-columns: 1fr;
    }

    .site-header {
        border-radius: 28px;
        flex-wrap: wrap;
    }

    .site-nav {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .content-grid,
    .explore-grid,
    .admin-stats-grid,
    .admin-layout,
    .admin-subgrid,
    .admin-activity-grid,
    .auth-page-grid,
    .splat-layout,
    .workspace-gallery {
        grid-template-columns: 1fr;
    }

    .admin-search {
        min-width: 100%;
    }

    .selected-file-meta,
    .splat-meta-grid {
        grid-template-columns: 1fr;
    }

    .splat-publish-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-feature,
    .card-wide {
        grid-column: auto;
        grid-row: auto;
        min-height: 320px;
    }
}

@media (max-width: 640px) {
    .page-shell {
        width: min(100% - 20px, 1200px);
        padding-top: 16px;
    }

    .hero {
        margin-top: 48px;
    }

    .features-section,
    .capabilities-section {
        margin-top: 64px;
    }

    h1 {
        font-size: 2.2rem;
    }

    .hero-actions {
        flex-direction: column;
    }

    .hero-actions .primary-button,
    .hero-actions .outline-button {
        width: 100%;
    }

    .top-actions,
    .site-nav {
        width: 100%;
        justify-content: center;
    }

    .nav-link {
        flex: 1;
        text-align: center;
    }

    .stat-card,
    .metric-card,
    .admin-list-item {
        padding: 18px;
    }

    .upload-progress-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .workspace-card,
    .card-feature,
    .card-wide {
        min-height: 260px;
        border-radius: 24px;
    }

    .workspace-overlay {
        inset: auto 16px 16px 16px;
    }
}

/* =====================================================================
   Home-page animations
   =====================================================================
   Everything below is opt-in: scoped to `body.has-anim` which site.js adds
   only on the home page (data-page="home") and only when JS + the relevant
   browser APIs are present. If the JS bail-outs at any step the page still
   renders fully — no flash of invisible content for users who hit a JS
   failure or have it disabled. The reduced-motion media query at the end
   force-disables every animation for users who prefer it.
   ===================================================================== */

/* --- Ambient drifting glow behind the whole page ----------------------
   Two soft radial highlights that slowly translate + scale to give the
   background a sense of depth without being distracting. */
@keyframes home-bg-drift {
    0%,
    100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.55; }
    50%  { transform: translate3d(28px, -16px, 0) scale(1.06); opacity: 0.9; }
}

body[data-page="home"]::before {
    content: "";
    position: fixed;
    inset: -10vh -10vw;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 22% 30%, rgba(79, 140, 255, 0.14), transparent 40%),
        radial-gradient(circle at 82% 22%, rgba(0, 212, 255, 0.10), transparent 36%),
        radial-gradient(circle at 50% 90%, rgba(127, 86, 217, 0.08), transparent 45%);
    animation: home-bg-drift 26s ease-in-out infinite;
}

body[data-page="home"] .page-shell {
    position: relative;
    z-index: 1;
}

/* --- Hero entry animation (runs once on page load) -------------------- */
@keyframes home-hero-rise {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}

body.has-anim .hero-stage {
    animation: home-hero-rise 1s cubic-bezier(0.16, 1, 0.3, 1) both;
}
body.has-anim .hero-overlay h1 {
    animation: home-hero-rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 0.30s;
}
body.has-anim .hero-overlay .hero-actions {
    animation: home-hero-rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 0.50s;
}

/* --- Scroll-reveal targets ------------------------------------------- */
body.has-anim .anim-fade-up {
    opacity: 0;
    transform: translateY(36px);
    transition:
        opacity 0.85s ease,
        transform 0.95s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
}
body.has-anim .anim-fade-up.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* --- Stagger: child elements fade in one-by-one when container is in
   view. Up to 8 children supported; beyond that they appear together. */
body.has-anim .anim-stagger > * {
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity 0.7s ease,
        transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
body.has-anim .anim-stagger.in-view > * { opacity: 1; transform: translateY(0); }
body.has-anim .anim-stagger.in-view > *:nth-child(1) { transition-delay: 0.05s; }
body.has-anim .anim-stagger.in-view > *:nth-child(2) { transition-delay: 0.15s; }
body.has-anim .anim-stagger.in-view > *:nth-child(3) { transition-delay: 0.25s; }
body.has-anim .anim-stagger.in-view > *:nth-child(4) { transition-delay: 0.35s; }
body.has-anim .anim-stagger.in-view > *:nth-child(5) { transition-delay: 0.45s; }
body.has-anim .anim-stagger.in-view > *:nth-child(6) { transition-delay: 0.55s; }
body.has-anim .anim-stagger.in-view > *:nth-child(7) { transition-delay: 0.65s; }
body.has-anim .anim-stagger.in-view > *:nth-child(8) { transition-delay: 0.75s; }

/* --- Feature card: idle + hover lift ---------------------------------- */
.feature-card {
    transition:
        transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.45s ease,
        border-color 0.45s ease,
        background 0.45s ease;
}
.feature-card:hover {
    transform: translateY(-8px);
    border-color: rgba(79, 140, 255, 0.45);
    box-shadow:
        0 22px 50px rgba(0, 0, 0, 0.42),
        0 0 0 1px rgba(79, 140, 255, 0.22);
    background: var(--bg-card-hover);
}
.feature-card .feature-icon {
    transition:
        transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        color 0.35s ease;
}
.feature-card:hover .feature-icon {
    transform: rotate(-8deg) scale(1.08);
    color: var(--accent-glow);
}

/* --- Button: shine sweep on hover ------------------------------------- */
.primary-button,
.outline-button {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.primary-button::before,
.outline-button::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        100deg,
        transparent 38%,
        rgba(255, 255, 255, 0.18) 50%,
        transparent 62%
    );
    transform: translateX(-110%);
    transition: transform 0.75s ease;
    pointer-events: none;
    z-index: 1;
}
.primary-button:hover::before,
.outline-button:hover::before {
    transform: translateX(110%);
}
.primary-button > *,
.outline-button > * {
    position: relative;
    z-index: 2;
}

/* --- Capabilities list items: subtle slide on hover ------------------- */
.capabilities-list li {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.capabilities-list li:hover {
    transform: translateX(6px);
}

/* --- Nav link active underline grows on hover ------------------------- */
.nav-link {
    position: relative;
}
.nav-link::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 4px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-glow));
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 2px;
    opacity: 0.85;
}
.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
}

/* --- Brand mark: soft pulsing ring ------------------------------------ */
@keyframes home-brand-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(79, 140, 255, 0.0); }
    50%      { box-shadow: 0 0 0 7px rgba(79, 140, 255, 0.0); }
}
@keyframes home-brand-glow {
    0%, 100% { filter: brightness(1); }
    50%      { filter: brightness(1.08) saturate(1.1); }
}
.brand-mark {
    animation:
        home-brand-pulse 3.2s ease-in-out infinite,
        home-brand-glow 4s ease-in-out infinite;
}

/* --- Reduced motion: respect the system preference ------------------- */
@media (prefers-reduced-motion: reduce) {
    body[data-page="home"]::before,
    body.has-anim *,
    body.has-anim *::before,
    body.has-anim *::after,
    .brand-mark {
        animation: none !important;
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
}

