/* ========================================
   FUN PAGE — FREE-FORM DRAGGABLE CANVAS
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;600&display=swap');


/* Disable canvas on mobile; show original page */
@media screen and (max-width: 767px) {
    #fun-canvas-viewport,
    #fun-dock,
    #fun-footer-strip {
        display: none !important;
    }

    body.fun-canvas-mode {
        overflow: auto !important;
        height: auto !important;
    }

    #fun-mobile-content {
        display: block !important;
    }

    body.fun-canvas-mode .section.fun-mobile-fallback,
    body.fun-canvas-mode .section.fun-mobile-fallback .w-layout-blockcontainer.container.w-container {
        display: block !important;
    }

    /* Force pinboard cards visible on mobile (override opacity:0 from fun-pinboard.css)
       Higher specificity needed because fun-pinboard.css loads AFTER fun-canvas.css. */
    body.fun-canvas-mode #fun-mobile-content .dt-right-feature-16 .dt-single-feature-16,
    body.fun-canvas-mode #fun-mobile-content .dt-single-feature-16 {
        opacity: 1 !important;
        transform: translateY(0) scale(1) !important;
    }

    /* Pin hero text size so it doesn't shrink on narrow viewports */
    body.fun-canvas-mode #fun-mobile-content .dt-text-scroll-move-1 {
        font-size: 3rem !important;
    }
}

/* Hide mobile fallback by default (desktop), show only on mobile */
#fun-mobile-content {
    display: none !important;
}

@media screen and (max-width: 767px) {
    #fun-mobile-content {
        display: block !important;
    }
}

/* ----------------------------------------
   LAYOUT TOKENS
   Single source of truth for navbar/footer
   heights — change here to ripple everywhere.
   ---------------------------------------- */
:root {
    --fc-navbar-h: 60px;
    --fc-footer-h: 48px;
}

/* Pin hero text size on fun page so it doesn't scale with viewport */
body.fun-canvas-mode .dt-text-scroll-move-1 {
    font-size: 76px !important;
}

/* ----------------------------------------
   VIEWPORT & BODY OVERRIDE
   ---------------------------------------- */
@media screen and (min-width: 768px) {
    body.fun-canvas-mode {
        overflow: hidden !important;
        height: 100dvh;
    }
}

/* Mobile fallback content is controlled by #fun-mobile-content display rules above */

/* ----------------------------------------
   CANVAS VIEWPORT
   Sits below navbar, above footer strip
   ---------------------------------------- */
#fun-canvas-viewport {
    position: fixed;
    top: var(--fc-navbar-h);
    left: 0;
    right: var(--ask-panel-offset-right, 0px);
    bottom: var(--fc-footer-h);
    overflow: hidden;
    cursor: grab;
    background: #0a0a0a;
    z-index: 1;
}

#fun-mobile-content {
    position: relative;
    right: var(--ask-panel-offset-right, 0px);
    width: calc(100% - var(--ask-panel-offset-right, 0px));
}

/* Mobile/tablet only: bottom gradient fade */
@media screen and (max-width: 991px) {
    #fun-canvas-viewport::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 25vh;
        background: linear-gradient(
            to bottom,
            transparent 0%,
            rgba(0, 0, 0, 0.50) 50%,
            rgba(0, 0, 0, 0.85) 100%
        );
        pointer-events: none;
        z-index: 2;
    }
}

#fun-canvas-viewport.is-panning {
    cursor: grabbing;
}

/* ----------------------------------------
   CANVAS BACKGROUND — dot grid
   ---------------------------------------- */
#fun-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 3200px;
    height: 2200px;
    transform-origin: 0 0;
    will-change: transform;
    background-color: #0a0a0a;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.09) 1px, transparent 1.4px);
    background-size: 26px 26px;
}

/* Mobile/tablet only: wider dot spacing */
@media screen and (max-width: 991px) {
    #fun-canvas {
        background-image: radial-gradient(circle, rgba(255, 255, 255, 0.12) 1.4px, transparent 1.8px);
        background-size: 48px 48px;
    }
}

/* ----------------------------------------
   CANVAS ITEMS — base
   ---------------------------------------- */
.canvas-item {
    position: absolute;
    cursor: grab;
    user-select: none;
    touch-action: none;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
    will-change: left, top;
}

.canvas-item.is-dragging {
    cursor: grabbing;
    z-index: 9999 !important;
    transition: box-shadow 0.2s ease;
}

/* ----------------------------------------
   HERO TEXT ITEM
   ---------------------------------------- */
.canvas-item.hero-item {
    width: 560px;
    padding: 32px 36px 28px;
    background: transparent;
    z-index: 10;
}

.canvas-item.hero-item .dt-master-scroll-move-1 {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.canvas-item.hero-item .dt-text-scroll-move-1 {
    color: #efeeec;
    font-size: clamp(2.4rem, 5vw, 4rem);
    font-weight: 400;
    line-height: 1.1;
    white-space: nowrap;
}

.canvas-item.hero-item .dt-second-scroll-move-2 {
    display: flex;
    align-items: center;
    gap: 14px;
}

.canvas-item.hero-item .dt-pill-scroll-move-1 {
    height: 3.4rem;
    width: auto;
    border-radius: 100px;
    object-fit: contain;
    display: inline-block;
    flex-shrink: 0;
}

/* ----------------------------------------
   DISCIPLINE CARDS
   ---------------------------------------- */
.canvas-item.card-item {
    /* Dark polaroid frame, matching the photo tiles */
    width: 280px;
    background: #17181a;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.canvas-item.card-item[data-href] {
    cursor: grab;
}

.canvas-item.card-item.is-dragging {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 4px 16px rgba(0, 0, 0, 0.5);
}

.canvas-item.card-item:not(.is-dragging):hover {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7), 0 4px 16px rgba(0, 0, 0, 0.4);
    transform: translateY(-4px) scale(1.01) rotate(var(--canvas-rot, 0deg)) !important;
}

.canvas-item.card-item .dt-image-feature-16 {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
    pointer-events: none;
    border-radius: 2px;
}

.canvas-item.card-item .dt-h3 {
    margin: 0;
    padding: 12px 6px 4px;
    color: #f7f8f8;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
}

.canvas-item.card-item[data-href] .dt-h3::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 12L12 4M12 4H6M12 4V10' stroke='rgba(255,255,255,0.4)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
    opacity: 0;
    transform: translate(2px, -2px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.canvas-item.card-item[data-href]:not(.is-dragging):hover .dt-h3::after {
    opacity: 1;
    transform: translate(0, 0);
}

.canvas-item.card-item .dt-body-big {
    padding: 0 6px 8px;
    color: rgba(247, 248, 248, 0.6);
    font-size: 0.8rem;
    line-height: 1.55;
    flex-grow: 1;
}

.canvas-item.card-item.is-selected {
    box-shadow:
        0 0 0 2px rgba(239, 238, 236, 0.5),
        0 16px 48px rgba(0, 0, 0, 0.8),
        0 4px 16px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255,255,255,0.1);
    transform: translateY(-6px) scale(1.02) rotate(var(--canvas-rot, 0deg)) !important;
}

.canvas-item.card-item .dt-divider-fade-out {
    display: none;
}

/* Sticker wrapper inside card */
.canvas-item.card-item .stickerwrapper {
    width: 100%;
    pointer-events: none;
}

.canvas-item.card-item .stickerwrapper .slider,
.canvas-item.card-item .stickerwrapper .w-slider {
    background: transparent !important;
    background-color: transparent !important;
    height: 200px;
}

/* ----------------------------------------
   PHOTO TILES
   ---------------------------------------- */
.canvas-item.photo-item {
    /* Polaroid frame in dark: thick border, extra weight at the bottom */
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.4);
    background: #17181a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 10px 36px;
    line-height: 0;
    cursor: zoom-in;
}

body.fun-canvas-mode.edit-mode .canvas-item.photo-item {
    cursor: grab;
}

.canvas-item.photo-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
    pointer-events: none;
}

/* Handwritten caption in the polaroid chin — up to two rows.
   The chin grows only when the caption actually wraps. */
.canvas-item.photo-item.has-caption {
    padding-bottom: 38px;
}

.canvas-item.photo-item.caption-two-lines {
    padding-bottom: 58px;
}

.canvas-item.photo-item .photo-caption {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 6px;
    font-family: 'Caveat', cursive;
    font-size: 20px;
    line-height: 23px;
    color: rgba(247, 248, 248, 0.78);
    text-align: left;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    pointer-events: none;
    outline: none;
}

.canvas-item.photo-item.caption-center .photo-caption {
    text-align: center;
}

body.fun-canvas-mode.edit-mode .canvas-item.photo-item .photo-caption {
    pointer-events: auto;
    cursor: text;
}

/* While typing: allow the caret and selection (canvas items disable both) */
.canvas-item.photo-item.is-editing-caption,
.canvas-item.photo-item.is-editing-caption .photo-caption {
    cursor: text;
    user-select: text;
    -webkit-user-select: text;
}

.canvas-item.photo-item.is-editing-caption .photo-caption {
    color: #f7f8f8;
    -webkit-line-clamp: unset;
    overflow: visible;
}

.canvas-item.photo-item:not(.is-dragging):hover {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    transform: scale(1.02) rotate(var(--canvas-rot, 0deg)) !important;
}

body.fun-canvas-mode.edit-mode .canvas-item.photo-item.is-selected {
    box-shadow:
        0 0 0 2px rgba(239, 238, 236, 0.5),
        0 16px 48px rgba(0, 0, 0, 0.8);
}

/* Resize handle */
.resize-handle {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    background: rgba(239, 238, 236, 0.5);
    cursor: nwse-resize;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
    z-index: 10;
}

body.fun-canvas-mode.edit-mode .canvas-item.photo-item:hover .resize-handle,
body.fun-canvas-mode.edit-mode .canvas-item.photo-item.is-selected .resize-handle,
body.fun-canvas-mode.edit-mode .canvas-item.photo-item.is-resizing .resize-handle {
    opacity: 1;
}

.canvas-item.photo-item .resize-handle:hover {
    background: rgba(239, 238, 236, 0.85);
}

/* Rotation handle — visible on all items in edit mode */
.rot-handle {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(239, 238, 236, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.3);
    cursor: grab;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

body.fun-canvas-mode.edit-mode .canvas-item:hover .rot-handle,
body.fun-canvas-mode.edit-mode .canvas-item.is-selected .rot-handle,
body.fun-canvas-mode.edit-mode .canvas-item.is-rotating .rot-handle {
    opacity: 1;
}

.rot-handle:hover {
    background: rgba(239, 238, 236, 0.9);
    transform: translateX(-50%) scale(1.15);
}

/* Rotation connector line */
.rot-handle::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    width: 1px;
    height: 8px;
    background: rgba(239, 238, 236, 0.4);
    transform: translateX(-50%);
}

/* Hide hover arrow on canvas cards */
.canvas-item.card-item .dt-h3::after {
    display: none !important;
}

/* ----------------------------------------
   HANDWRITTEN TEXT NOTES
   ---------------------------------------- */
.canvas-item.text-item {
    min-width: 60px;
    min-height: 30px;
    cursor: grab;
    user-select: none;
    font-family: 'Caveat', cursive;
    font-size: 1.6rem;
    line-height: 1.3;
    color: rgba(239, 238, 236, 0.9);
    z-index: 10;
    /* pre: manual Shift+Enter breaks render as rows, no auto-wrap */
    white-space: pre;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.canvas-item.text-item.is-editing {
    cursor: text;
    user-select: text;
}

.canvas-item.text-item.is-selected {
    text-shadow: 0 0 8px rgba(239, 238, 236, 0.3), 0 1px 3px rgba(0,0,0,0.4);
}

.canvas-item.text-item .note-text {
    outline: none;
    display: inline-block;
    min-width: 10px;
}

.canvas-item.text-item .note-text:empty::before {
    content: 'Write something...';
    color: rgba(239, 238, 236, 0.35);
}

/* ----------------------------------------
   ROTATION via CSS variable set inline
   ---------------------------------------- */
.canvas-item {
    transform: rotate(var(--canvas-rot, 0deg));
}

.canvas-item.is-dragging {
    transform: rotate(var(--canvas-rot, 0deg)) scale(1.03) !important;
}

/* ----------------------------------------
   FIXED FOOTER STRIP
   ---------------------------------------- */
#fun-footer-strip {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--fc-footer-h);
    background: rgba(20, 20, 20, 0.92);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
    gap: 16px;
}

#fun-footer-strip .footer-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

#fun-footer-strip a {
    color: rgba(239, 238, 236, 0.8);
    text-decoration: none;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    transition: color 0.2s ease;
    white-space: nowrap;
}

#fun-footer-strip a:hover {
    color: #efeeec;
}

#fun-footer-strip .footer-socials {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

#fun-footer-strip .footer-socials a {
    display: flex;
    align-items: center;
    color: rgba(239, 238, 236, 0.7);
}

#fun-footer-strip .footer-socials a:hover {
    color: #efeeec;
}

#fun-footer-strip .footer-socials svg {
    width: 16px;
    height: 16px;
}

/* ----------------------------------------
   DT-SECTION OVERLAY IMAGE
   ---------------------------------------- */
.canvas-item.overlay-item {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255,255,255,0.06);
    line-height: 0;
}

.canvas-item.overlay-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* ----------------------------------------
   MACOS-STYLE DOCK
   ---------------------------------------- */
#fun-dock {
    position: fixed;
    bottom: 68px;
    left: calc(50% - var(--ask-panel-offset-right, 0px) / 2);
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(28, 28, 32, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    padding: 5px 8px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.05);
}

.dock-item {
    position: relative;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 9px;
    color: rgba(255, 255, 255, 0.82);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
    user-select: none;
    flex-shrink: 0;
    overflow: visible;
}

.dock-item:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.dock-item:active {
    transform: scale(0.93);
    transition: transform 0.1s ease;
}

.dock-item svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    pointer-events: none;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dock-item:hover svg {
    transform: scale(1.08);
}

/* Tooltip */
.dock-item[data-label]::before {
    content: attr(data-label);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(24, 24, 28, 0.95);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.68rem;
    font-family: inherit;
    font-weight: 400;
    letter-spacing: 0.03em;
    white-space: nowrap;
    padding: 4px 9px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 300;
}

.dock-item[data-label]:hover::before {
    opacity: 1;
}

/* Primary dock action — filled pill with a visible label */
.dock-item.dock-item-primary {
    width: auto;
    height: 32px;
    flex-shrink: 0;
    gap: 7px;
    padding: 0 13px 0 10px;
    margin-right: 2px;
    background: #f7f8f8;
    color: #0b0c0d;
    font-weight: 600;
    white-space: nowrap;
}

.dock-item.dock-item-primary:hover {
    background: #ffffff;
    color: #000000;
}

.dock-item.dock-item-primary svg {
    width: 14px;
    height: 14px;
}

.dock-primary-label {
    font-size: 0.78rem;
    letter-spacing: 0.01em;
    line-height: 1;
    font-family: inherit;
}

/* Dock divider */
.dock-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
    align-self: center;
    margin: 0 2px;
}

/* Mobile: hide dock */
@media screen and (max-width: 767px) {
    #fun-dock {
        display: none !important;
    }
}

/* ----------------------------------------
   FLOATING ACTION MENU
   ---------------------------------------- */
#fun-floating-menu {
    position: fixed;
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#fun-floating-menu.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.fab-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(239, 238, 236, 0.9);
    border: none;
    color: #1a1a1a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    transition: background 0.2s ease, transform 0.15s ease;
    user-select: none;
}

.fab-btn:hover {
    background: #efeeec;
    transform: scale(1.08);
}

.fab-btn:active {
    transform: scale(0.96);
}

/* Mobile/tablet: larger floating buttons */
@media screen and (max-width: 991px) {
    .fab-btn {
        width: 52px;
        height: 52px;
    }
    .fab-btn svg {
        width: 20px;
        height: 20px;
    }
}

body.fun-canvas-mode.read-mode .canvas-item {
    cursor: grab;
}

/* Cards that link out read as clickable */
body.fun-canvas-mode.read-mode .canvas-item.card-item[data-href] {
    cursor: pointer;
}

body.fun-canvas-mode.read-mode .canvas-item.is-selected {
    outline: none !important;
    box-shadow: none !important;
}

/* ----------------------------------------
   MOBILE — touch-friendly adjustments
   ---------------------------------------- */
@media screen and (max-width: 767px) {
    #fun-canvas-viewport {
        top: var(--fc-navbar-h);
        bottom: var(--fc-footer-h);
    }

    #fun-footer-strip {
        height: var(--fc-footer-h);
        padding: 0 16px;
    }

    #fun-footer-strip .footer-links {
        gap: 12px;
    }

    #fun-footer-strip a {
        font-size: 0.72rem;
    }

    .canvas-item.card-item {
        width: 240px;
    }

    .canvas-item.hero-item {
        width: 320px;
        padding: 24px 24px 20px;
    }

    .canvas-item.hero-item .dt-text-scroll-move-1 {
        font-size: 2rem;
    }
}

/* ── Next.js overrides ── */
:root { --fc-navbar-h: 56px; }

/* ══ Design system overrides — matches Next.js site tokens ══════════════ */

/* Canvas background — dot grid on the site's near-black */
#fun-canvas-viewport { background: #010102; }
#fun-canvas {
  background-color: #010102;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.09) 1px, transparent 1.4px);
  background-size: 26px 26px;
}

/* Cards — dark polaroid frame */
.canvas-item.card-item {
  background: #17181a;
  border: 1px solid #23252a;
  box-shadow: 0 4px 24px rgba(0,0,0,0.6);
  border-radius: 4px;
  font-family: "Satoshi", system-ui, -apple-system, sans-serif;
}
.canvas-item.card-item:not(.is-dragging):hover {
  border-color: #34343a;
  box-shadow: 0 16px 48px rgba(0,0,0,0.7);
}
.canvas-item.card-item.is-dragging {
  box-shadow: 0 24px 64px rgba(0,0,0,0.9);
}
.canvas-item.card-item .dt-h3 {
  color: #f7f8f8;
  font-family: "Satoshi", system-ui, -apple-system, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.canvas-item.card-item .dt-body-big {
  color: #8a8f98;
  font-family: "Satoshi", system-ui, -apple-system, sans-serif;
  font-size: 0.775rem;
}

/* Photo tiles — dark polaroid frame */
.canvas-item.photo-item {
  background: #17181a;
  border: 1px solid #23252a;
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7);
}
.canvas-item.photo-item:not(.is-dragging):hover {
  box-shadow: 0 20px 60px rgba(0,0,0,0.85);
}

/* Hero text */
.canvas-item.hero-item .dt-text-scroll-move-1 { color: #f7f8f8; }

/* Dock */
#fun-dock {
  background: rgba(15,16,17,0.92);
  border-color: #23252a;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.04);
}
.dock-item { color: #8a8f98; }
.dock-item:hover { background: #141516; color: #f7f8f8; }

/* Footer strip */
#fun-footer-strip {
  background: rgba(1,1,2,0.95);
  border-top-color: #23252a;
}

/* ----------------------------------------
   LOADING CURTAIN
   Desktop: canvas items sit unpositioned at
   the origin until fun-canvas.js lays them
   out. Mobile: the fallback list still needs
   a beat to settle in on client-side nav.
   Either way, an opaque curtain covers the
   page until init adds body.fun-loaded.
   ---------------------------------------- */
#fun-page-loader {
  position: fixed;
  top: var(--fc-navbar-h);
  left: 0;
  right: var(--ask-panel-offset-right, 0px);
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background-color: #010102;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.09) 1px, transparent 1.4px);
  background-size: 26px 26px;
  pointer-events: none;
  transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}

body.fun-loaded #fun-page-loader {
  opacity: 0;
  visibility: hidden;
}

#fun-page-loader .loader-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8a8f98;
  animation: fc-loader-pulse 1.1s ease-in-out infinite;
}

#fun-page-loader .loader-dot:nth-child(2) { animation-delay: 0.15s; }
#fun-page-loader .loader-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes fc-loader-pulse {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50%      { opacity: 1;    transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  #fun-page-loader .loader-dot { animation: none; opacity: 0.6; }
}

/* ----------------------------------------
   PHOTO LIGHTBOX — tap a photo to preview
   it big, as one large polaroid
   ---------------------------------------- */
#fun-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
  background: rgba(1, 1, 2, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.22s ease;
  cursor: zoom-out;
}

#fun-lightbox.is-open { opacity: 1; }

#fun-lightbox figure {
  position: relative;
  margin: 0;
  background: #17181a;
  border: 1px solid #23252a;
  padding: 14px 14px 48px;
  border-radius: 4px;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.8);
  transform: scale(0.94);
  transition: transform 0.22s ease;
  line-height: 0;
}

#fun-lightbox figure.has-caption {
  padding-bottom: 56px;
}

#fun-lightbox figure.caption-two-lines {
  padding-bottom: 78px;
}

#fun-lightbox figure.caption-center figcaption {
  text-align: center;
}

#fun-lightbox figcaption {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 10px;
  font-family: 'Caveat', cursive;
  font-size: 24px;
  line-height: 28px;
  color: rgba(247, 248, 248, 0.8);
  text-align: left;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#fun-lightbox.is-open figure { transform: scale(1); }

#fun-lightbox img {
  display: block;
  max-width: min(88vw, 960px);
  max-height: calc(88vh - 62px);
  object-fit: contain;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  #fun-lightbox, #fun-lightbox figure { transition: none; }
}

/* ----------------------------------------
   CLUSTER LABELS — faint handwritten
   signposts behind each neighborhood
   ---------------------------------------- */
.cluster-label {
  position: absolute;
  font-family: 'Caveat', cursive;
  font-size: 46px;
  line-height: 1;
  color: rgba(247, 248, 248, 0.55);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  transform: rotate(var(--canvas-rot, 0deg));
  z-index: 1;
}

/* Authors can drag/rotate the labels in edit mode */
body.fun-canvas-mode.edit-mode .cluster-label {
  pointer-events: auto;
  cursor: grab;
}

body.fun-canvas-mode.edit-mode .cluster-label:hover {
  color: rgba(247, 248, 248, 0.75);
}

/* ----------------------------------------
   HIDDEN NOTES — discovery reveal
   Notes start invisible for visitors and
   pop in when panned into view.
   ---------------------------------------- */
body.fun-canvas-mode.read-mode .canvas-item.text-item {
  transition:
    opacity 0.55s ease,
    transform 0.65s cubic-bezier(0.34, 1.56, 0.64, 1),
    text-shadow 0.2s ease;
}

body.fun-canvas-mode.read-mode .canvas-item.text-item:not(.is-revealed) {
  opacity: 0;
  transform: rotate(var(--canvas-rot, 0deg)) scale(0.55);
  pointer-events: none;
}
