/* =============================================================
   PPUZZL.works v2 — Holographic Bubble Atelier
   Palette: #FFFFFF #F6F1E6 #2A2540 #F4C75A #E879B6 #6BD4D0 #EDE3D2 #5C4D7A
   Fonts: Quicksand (display), Nunito (body/HUD), Caveat (handwriting),
          JetBrains Mono (snippet)
   ============================================================= */

:root {
    --foam-white: #FFFFFF;
    --pearl-substrate: #F6F1E6;
    --lantern-shadow: #EDE3D2;
    --ink-plum: #2A2540;
    --bench-lavender: #5C4D7A;
    --film-cyan: #6BD4D0;
    --film-magenta: #E879B6;
    --film-yellow: #F4C75A;

    --bubble-cycle: 24s;
    --rim-width: 3px;
    --ribbon-top-h: 56px;
    --ribbon-bot-h: 44px;
    --rail-w: 64px;

    --ease-elastic: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-glide: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Nunito', system-ui, -apple-system, sans-serif;
    font-weight: 400;
    color: var(--ink-plum);
    background-color: var(--pearl-substrate);
    min-height: 100vh;
    line-height: 1.62;
    overflow-x: hidden;
    cursor: default;
}

/* ============================================================
   ATELIER PLATE: fixed pearl-lantern background
   ============================================================ */

.atelier-plate {
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(ellipse at 22% 18%, rgba(232, 121, 182, 0.10) 0%, rgba(232, 121, 182, 0) 60%),
        radial-gradient(ellipse at 78% 30%, rgba(107, 212, 208, 0.10) 0%, rgba(107, 212, 208, 0) 55%),
        radial-gradient(ellipse at 50% 80%, rgba(244, 199, 90, 0.08) 0%, rgba(244, 199, 90, 0) 60%),
        linear-gradient(150deg, #F6F1E6 0%, #F1ECDD 35%, #EDE3D2 100%);
    pointer-events: none;
}

.atelier-noise {
    position: absolute;
    inset: 0;
    opacity: 0.32;
    mix-blend-mode: multiply;
    background-image:
        radial-gradient(circle at 12% 8%, rgba(42, 37, 64, 0.04) 0.6px, transparent 1px),
        radial-gradient(circle at 38% 24%, rgba(42, 37, 64, 0.03) 0.5px, transparent 1px),
        radial-gradient(circle at 67% 52%, rgba(42, 37, 64, 0.04) 0.7px, transparent 1px),
        radial-gradient(circle at 88% 12%, rgba(42, 37, 64, 0.03) 0.5px, transparent 1px),
        radial-gradient(circle at 22% 78%, rgba(42, 37, 64, 0.04) 0.6px, transparent 1px),
        radial-gradient(circle at 52% 88%, rgba(42, 37, 64, 0.03) 0.5px, transparent 1px),
        radial-gradient(circle at 78% 68%, rgba(42, 37, 64, 0.04) 0.6px, transparent 1px);
    background-size: 240px 240px;
    background-repeat: repeat;
    pointer-events: none;
}

.particle-ambience {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.ambience-dot {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    animation: dot-drift linear infinite;
    box-shadow: 0 0 6px currentColor;
}

@keyframes dot-drift {
    0%   { transform: translate(0, 0); opacity: 0; }
    8%   { opacity: 0.85; }
    50%  { transform: translate(20px, -120px); opacity: 0.7; }
    92%  { opacity: 0.4; }
    100% { transform: translate(-30px, -260px); opacity: 0; }
}

/* ============================================================
   CURSOR TRAIL
   ============================================================ */

.cursor-trail {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9000;
}

.trail-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--film-yellow) 0%, rgba(244, 199, 90, 0) 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    will-change: opacity, transform;
}

/* ============================================================
   LEDGER RIBBONS — Top + Bottom HUD chrome
   ============================================================ */

.ledger-ribbon {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    width: min(70%, 1080px);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.72);
    border-radius: 16px;
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    box-shadow:
        0 6px 24px rgba(82, 60, 130, 0.12),
        inset 0 0 0 1px rgba(244, 199, 90, 0.0);
    animation: ribbon-rim-hue 8s linear infinite;
    will-change: box-shadow;
}

@keyframes ribbon-rim-hue {
    0%   { box-shadow: 0 6px 24px rgba(82, 60, 130, 0.12), inset 0 0 0 1px rgba(107, 212, 208, 0.45); }
    33%  { box-shadow: 0 6px 24px rgba(82, 60, 130, 0.12), inset 0 0 0 1px rgba(232, 121, 182, 0.45); }
    66%  { box-shadow: 0 6px 24px rgba(82, 60, 130, 0.12), inset 0 0 0 1px rgba(244, 199, 90, 0.45); }
    100% { box-shadow: 0 6px 24px rgba(82, 60, 130, 0.12), inset 0 0 0 1px rgba(107, 212, 208, 0.45); }
}

.ledger-top {
    top: 16px;
    height: var(--ribbon-top-h);
}

.ledger-bottom {
    bottom: 16px;
    height: var(--ribbon-bot-h);
}

.ribbon-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 22px;
    gap: 18px;
}

.wordmark {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: clamp(18px, 1.4vw, 22px);
    letter-spacing: -0.005em;
    color: var(--ink-plum);
    display: inline-flex;
    min-width: 160px;
}

.wordmark .wm-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(-6px) scale(1.05);
    transition: opacity 220ms ease, transform 220ms var(--ease-elastic);
}

.wordmark .wm-char.in {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.compass-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

.compass-rose {
    width: 28px;
    height: 28px;
}

.compass-needle {
    transform-origin: 30px 30px;
    transition: transform 600ms var(--ease-glide);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(246, 241, 230, 0.6);
    border: 1px solid rgba(92, 77, 122, 0.18);
}

.pill-label {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bench-lavender);
}

.pill-value {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.04em;
    color: var(--ink-plum);
    min-width: 220px;
    display: inline-block;
}

/* Bottom ribbon parts */

.ribbon-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 320px;
}

.ribbon-label {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--film-magenta);
}

.ribbon-caption {
    font-family: 'Nunito', sans-serif;
    font-weight: 500;
    font-size: 12px;
    color: var(--ink-plum);
}

.ribbon-clock-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.atelier-clock {
    width: 22px;
    height: 22px;
}

.clock-label {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--bench-lavender);
}

#clockSec {
    transform-origin: 16px 16px;
    transition: transform 200ms var(--ease-glide);
}

#clockSec.tick-flash {
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.9));
}

.ribbon-popcount {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: 14px;
    background: rgba(244, 199, 90, 0.18);
    border: 1px solid rgba(244, 199, 90, 0.5);
}

.pop-label {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bench-lavender);
}

.pop-value {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: var(--film-yellow);
    text-shadow: 0 0 6px rgba(244, 199, 90, 0.5);
    min-width: 32px;
    text-align: center;
}

.pop-value.bump {
    animation: pop-bump 480ms var(--ease-elastic);
}

@keyframes pop-bump {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.36); }
    100% { transform: scale(1); }
}

/* ============================================================
   SPECIMEN RAIL (right-edge)
   ============================================================ */

.specimen-rail {
    position: fixed;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: var(--rail-w);
    max-height: calc(100vh - 200px);
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    backdrop-filter: blur(8px) saturate(130%);
    -webkit-backdrop-filter: blur(8px) saturate(130%);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 6px 24px rgba(82, 60, 130, 0.10);
}

.rail-cap {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bench-lavender);
    opacity: 0.7;
}

.mini-bubbles {
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    flex: 1;
    overflow-y: auto;
}

.mini-bubble {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 30%, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.6) 50%, rgba(92,77,122,0.18) 100%);
    border: 1px solid rgba(92, 77, 122, 0.25);
    cursor: pointer;
    position: relative;
    transition: transform 240ms var(--ease-elastic), box-shadow 240ms ease;
}

.mini-bubble::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--film-cyan), var(--film-magenta), var(--film-yellow), var(--film-cyan));
    opacity: 0;
    z-index: -1;
    transition: opacity 220ms ease;
}

.mini-bubble:hover {
    transform: scale(1.18);
}

.mini-bubble:hover::after {
    opacity: 0.5;
}

.mini-bubble.is-active {
    box-shadow: 0 0 0 2px rgba(107, 212, 208, 0.85), 0 0 14px rgba(107, 212, 208, 0.55);
    transform: scale(1.22);
}

.mini-bubble.is-active::after {
    opacity: 0.7;
}

.mini-bubble.size-s { width: 12px; height: 12px; }
.mini-bubble.size-m { width: 18px; height: 18px; }
.mini-bubble.size-l { width: 26px; height: 26px; }

/* ============================================================
   BUBBLE FIELD — clusters
   ============================================================ */

.bubble-field {
    position: relative;
    z-index: 1;
    padding-top: calc(var(--ribbon-top-h) + 56px);
    padding-bottom: calc(var(--ribbon-bot-h) + 56px);
    width: 100%;
}

.cluster {
    position: relative;
    width: 100%;
    min-height: 100vh;
    padding: 80px 80px 80px 80px;
    margin-bottom: 60px;
}

.cluster-title {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    letter-spacing: -0.005em;
    font-size: clamp(28px, 4vw, 56px);
    color: var(--ink-plum);
    position: absolute;
    left: 80px;
    top: 30px;
    z-index: 2;
    pointer-events: none;
    opacity: 0.85;
}

.cluster-eyebrow {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bench-lavender);
    position: absolute;
    left: 80px;
    top: clamp(76px, 7vh, 96px);
    z-index: 2;
    opacity: 0.75;
}

.bubble-cluster {
    position: relative;
    width: 100%;
    height: 75vh;
    min-height: 600px;
}

/* ============================================================
   BUBBLE — the central unit
   ============================================================ */

.bubble {
    position: absolute;
    width: 220px;
    height: 220px;
    transform: translate(-50%, -50%);
    cursor: pointer;
    will-change: transform;
    --drift-x: 0px;
    --drift-y: 0px;
    --drift-rot: 0deg;
    --hover-lift: 0px;
    --hover-scale: 1;
    --flip-rot: 0deg;
    --pop-scale-x: 1;
    --pop-scale-y: 1;
    --drag-x: 0px;
    --drag-y: 0px;
    --depth-blur: 0px;
    --reform-scale: 1;
    perspective: 1000px;
    z-index: 10;
}

.bubble[data-depth="0"] { z-index: 30; }
.bubble[data-depth="1"] { z-index: 20; --depth-blur: 0.8px; }
.bubble[data-depth="2"] { z-index: 10; --depth-blur: 1.6px; }

.bubble.bubble-small    { width: 140px; height: 140px; }
.bubble.bubble-medium   { width: 240px; height: 240px; }
.bubble.bubble-large    { width: 340px; height: 340px; }
.bubble.bubble-xlarge   { width: 520px; height: 520px; }

@media (max-width: 1100px) {
    .bubble.bubble-xlarge { width: 380px; height: 380px; }
    .bubble.bubble-large  { width: 280px; height: 280px; }
}

@media (max-width: 720px) {
    .bubble { transform-origin: center; }
    .bubble.bubble-xlarge { width: 280px; height: 280px; }
    .bubble.bubble-large  { width: 220px; height: 220px; }
    .bubble.bubble-medium { width: 180px; height: 180px; }
    .bubble.bubble-small  { width: 110px; height: 110px; }
    .cluster { padding: 60px 24px; }
    .cluster-title { left: 24px; }
    .cluster-eyebrow { left: 24px; }
    .specimen-rail { display: none; }
    .ledger-ribbon { width: calc(100% - 32px); }
    .status-pill .pill-value { min-width: 100px; font-size: 11px; }
    .ribbon-status { min-width: 0; }
}

.bubble-thread {
    position: absolute;
    left: 50%;
    bottom: 92%;
    width: 8px;
    height: 200px;
    transform: translateX(-50%);
    pointer-events: none;
    opacity: 1;
    transition: opacity 320ms ease;
}

.bubble-thread svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.bubble-thread svg path {
    transition: stroke-opacity 320ms ease, opacity 320ms ease;
}

.bubble:hover .bubble-thread svg path {
    opacity: 0.35;
}

.thread-clip {
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--pearl-substrate);
    border: 1px solid var(--bench-lavender);
    border-radius: 50%;
    opacity: 0.5;
}

.bubble-skin {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    transform-style: preserve-3d;
    filter: blur(var(--depth-blur));
    transform:
        translate3d(var(--drift-x), calc(var(--drift-y) - var(--hover-lift)), 0)
        translate3d(var(--drag-x), var(--drag-y), 0)
        rotate(var(--drift-rot))
        scale(calc(var(--hover-scale) * var(--reform-scale)))
        scale(var(--pop-scale-x), var(--pop-scale-y));
    transition: filter 320ms ease;
    will-change: transform;
}

.bubble.is-deep .bubble-skin { filter: blur(1.5px); }

.bubble-faces {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    transform-style: preserve-3d;
    transform: rotateY(var(--flip-rot));
    transition: transform 700ms var(--ease-elastic);
}

.bubble-face {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    isolation: isolate;
}

.bubble-face-back {
    transform: rotateY(180deg);
}

.bubble-fill {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%,
            rgba(255, 255, 255, 0.95) 0%,
            rgba(255, 255, 255, 0.90) 40%,
            rgba(92, 77, 122, 0.12) 100%);
    pointer-events: none;
}

.bubble-rim {
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        var(--film-cyan),
        var(--film-magenta) 33%,
        var(--film-yellow) 66%,
        var(--film-cyan) 100%
    );
    animation: rim-rotate var(--bubble-cycle) linear infinite;
    pointer-events: none;
    z-index: 0;
    -webkit-mask: radial-gradient(circle, transparent 60%, #000 62%, #000 100%);
            mask: radial-gradient(circle, transparent 60%, #000 62%, #000 100%);
    opacity: 0.85;
    filter: blur(0.3px);
}

@keyframes rim-rotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.bubble:hover .bubble-rim {
    animation-duration: 12s;
    opacity: 1;
}

.bubble-highlight {
    position: absolute;
    top: 8%;
    left: 12%;
    width: 36%;
    height: 28%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0) 70%);
    pointer-events: none;
    z-index: 2;
    transform: rotate(-22deg);
}

.bubble-flash {
    position: absolute;
    inset: 4%;
    border-radius: 50%;
    background: conic-gradient(
        from 90deg,
        rgba(107, 212, 208, 0.0) 0%,
        rgba(107, 212, 208, 0.8) 25%,
        rgba(232, 121, 182, 0.8) 50%,
        rgba(244, 199, 90, 0.8) 75%,
        rgba(107, 212, 208, 0.0) 100%
    );
    mix-blend-mode: screen;
    opacity: 0;
    pointer-events: none;
    z-index: 5;
    transition: opacity 100ms ease;
}

.bubble.is-flashing .bubble-flash {
    animation: flash-sweep 220ms ease-out;
}

@keyframes flash-sweep {
    0%   { opacity: 0; transform: scale(0.85); }
    50%  { opacity: 1; transform: scale(1.02); }
    100% { opacity: 0; transform: scale(1.06); }
}

/* hover glow */

.bubble::before {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(107, 212, 208, 0.0) 50%, rgba(107, 212, 208, 0.0) 100%);
    pointer-events: none;
    transition: background 320ms ease;
    z-index: -1;
}

.bubble:hover::before {
    background: radial-gradient(circle, rgba(107, 212, 208, 0.30) 0%, rgba(107, 212, 208, 0) 70%);
}

.bubble.is-focus::before {
    background: radial-gradient(circle, rgba(107, 212, 208, 0.22) 0%, rgba(107, 212, 208, 0) 70%);
}

/* hover lift state from JS */

.bubble.is-hover {
    --hover-lift: 8px;
    --hover-scale: 1.04;
}

.bubble.is-flipped .bubble-faces {
    transform: rotateY(180deg);
}

.bubble.is-dragging {
    cursor: grabbing;
    z-index: 100;
}

.bubble.is-dragging .bubble-thread svg path {
    opacity: 0.55;
}

/* ============================================================
   BUBBLE CONTENT
   ============================================================ */

.bubble-content {
    position: relative;
    z-index: 3;
    width: 78%;
    height: 78%;
    max-width: 78%;
    max-height: 78%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 6%;
    color: var(--ink-plum);
}

.bubble-tag {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bench-lavender);
    margin-bottom: 6px;
}

.back-tag { color: var(--film-magenta); }

.bubble .manifesto-title {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: clamp(18px, 1.6vw, 26px);
    letter-spacing: -0.005em;
    line-height: 1.16;
    color: var(--ink-plum);
    margin: 4px 0 8px;
    max-width: 86%;
}

.bubble .manifesto-title em {
    font-style: italic;
    color: var(--bench-lavender);
    font-weight: 600;
}

.bubble-h3 {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: clamp(15px, 1.2vw, 19px);
    letter-spacing: -0.005em;
    color: var(--ink-plum);
    margin-bottom: 4px;
}

.bubble-body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(12px, 1vw, 14px);
    line-height: 1.55;
    color: var(--ink-plum);
    max-width: 86%;
}

.bubble-body.small {
    font-size: 12px;
    line-height: 1.45;
}

.bubble-hint {
    font-family: 'Caveat', cursive;
    font-weight: 500;
    font-size: 18px;
    color: var(--film-magenta);
    margin-top: 6px;
    line-height: 1;
}

.bubble-list {
    list-style: none;
    padding: 0;
    margin: 6px 0 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: center;
}

.bubble-list.small li {
    font-size: 11px;
}

.bubble-list li {
    font-family: 'Nunito', sans-serif;
    font-weight: 500;
    font-size: 12px;
    color: var(--bench-lavender);
}

.bubble-list li::before {
    content: '· ';
    color: var(--film-cyan);
    font-weight: 700;
}

.bubble-glyph {
    width: 50%;
    max-width: 64px;
    height: auto;
    opacity: 0.85;
}

.specimen-art {
    width: 70%;
    max-width: 88px;
    margin-bottom: 4px;
    opacity: 0.9;
}

.specimen-art.small { max-width: 60px; }

.specimen-label {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: clamp(14px, 1.1vw, 18px);
    color: var(--ink-plum);
    margin: 0;
}

.specimen-label.small { font-size: 14px; }

.specimen-sub {
    font-family: 'Nunito', sans-serif;
    font-weight: 500;
    font-size: 11px;
    color: var(--bench-lavender);
    letter-spacing: 0.04em;
}

.caveat-note {
    font-family: 'Caveat', cursive;
    font-weight: 500;
    font-size: 22px;
    line-height: 1.1;
    color: var(--ink-plum);
}

.caveat-note.small { font-size: 18px; }

.caveat-aside {
    font-family: 'Caveat', cursive;
    font-weight: 500;
    font-size: 18px;
    color: var(--film-magenta);
    margin-top: 6px;
}

.caveat-sketch {
    width: 60%;
    max-width: 80px;
    height: auto;
    margin-bottom: 4px;
    opacity: 0.92;
}

.snippet-mono {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 11px;
    line-height: 1.4;
    color: var(--ink-plum);
    background: rgba(237, 227, 210, 0.6);
    padding: 6px 10px;
    border-radius: 8px;
    margin-top: 6px;
    white-space: pre;
    text-align: left;
    max-width: 88%;
    overflow: hidden;
}

/* ============================================================
   PUZZLE DEMO (Workbench Bubble)
   ============================================================ */

.puzzle-grid {
    width: 132px;
    height: 132px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 4px;
    margin: 8px auto 4px;
    padding: 4px;
    background: rgba(237, 227, 210, 0.5);
    border-radius: 12px;
}

.puzzle-tile {
    background: linear-gradient(140deg, var(--foam-white) 0%, rgba(244, 199, 90, 0.25) 100%);
    border: 1px solid rgba(92, 77, 122, 0.22);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: var(--ink-plum);
    cursor: pointer;
    transition: transform 220ms var(--ease-elastic), background 220ms ease;
    user-select: none;
}

.puzzle-tile:hover {
    transform: scale(1.05);
}

.puzzle-tile.empty {
    background: transparent;
    border-color: transparent;
    cursor: default;
}

.puzzle-tile.empty:hover {
    transform: none;
}

.puzzle-status {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 11px;
    color: var(--bench-lavender);
    letter-spacing: 0.04em;
    margin-top: 4px;
}

/* ============================================================
   PRISM MIXER (Workbench Bubble)
   ============================================================ */

.mixer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 80%;
    margin: 8px auto 4px;
}

.mixer-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mixer-label {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bench-lavender);
    min-width: 56px;
    text-align: left;
}

.mixer-slider {
    flex: 1;
    appearance: none;
    -webkit-appearance: none;
    height: 4px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--film-cyan), var(--film-magenta), var(--film-yellow));
    outline: none;
    cursor: pointer;
}

.mixer-slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--foam-white);
    border: 1.5px solid var(--bench-lavender);
    box-shadow: 0 2px 6px rgba(82, 60, 130, 0.25);
    cursor: grab;
}

.mixer-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--foam-white);
    border: 1.5px solid var(--bench-lavender);
    cursor: grab;
}

.mixer-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 4px auto 0;
    background: conic-gradient(
        from 0deg,
        var(--film-cyan),
        var(--film-magenta) 33%,
        var(--film-yellow) 66%,
        var(--film-cyan)
    );
    animation: rim-rotate 8s linear infinite;
    -webkit-mask: radial-gradient(circle, transparent 50%, #000 52%);
            mask: radial-gradient(circle, transparent 50%, #000 52%);
}

/* ============================================================
   BUBBLE FORM (Sign-out Bay)
   ============================================================ */

.bubble-form {
    width: 88%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}

.bubble-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
    text-align: left;
}

.field-label {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 9px;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--bench-lavender);
}

.field-input {
    width: 100%;
    padding: 5px 8px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(92, 77, 122, 0.25);
    border-radius: 8px;
    font-family: 'Nunito', sans-serif;
    font-size: 11px;
    color: var(--ink-plum);
    outline: none;
    transition: border-color 220ms ease, box-shadow 220ms ease;
}

.field-input:focus {
    border-color: var(--film-cyan);
    box-shadow: 0 0 0 3px rgba(107, 212, 208, 0.20);
}

.field-area {
    resize: none;
    min-height: 40px;
    font-family: 'Caveat', cursive;
    font-size: 16px;
    line-height: 1.2;
}

.bubble-submit {
    align-self: center;
    margin-top: 4px;
    padding: 6px 16px;
    border: none;
    background: linear-gradient(135deg, var(--film-cyan), var(--film-magenta), var(--film-yellow));
    background-size: 200% 200%;
    color: var(--ink-plum);
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(82, 60, 130, 0.18);
    animation: gradient-shift 8s ease infinite;
    transition: transform 220ms var(--ease-elastic);
}

.bubble-submit:hover {
    transform: scale(1.06);
}

@keyframes gradient-shift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.form-status {
    font-family: 'Caveat', cursive;
    font-size: 16px;
    color: var(--film-magenta);
    min-height: 18px;
    margin-top: 2px;
    text-align: center;
    align-self: center;
    width: 100%;
}

/* ============================================================
   LANTERN DIM (Sign-out closing)
   ============================================================ */

.lantern-dim {
    position: absolute;
    inset: -40px;
    background: radial-gradient(ellipse at 50% 50%, rgba(0,0,0,0) 35%, rgba(92, 77, 122, 0.10) 75%, rgba(42, 37, 64, 0.18) 100%);
    pointer-events: none;
    z-index: 0;
    opacity: 0.7;
}

/* ============================================================
   IRIDESCENCE OVERLAY (page-wide click effect)
   ============================================================ */

.iridescence-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: conic-gradient(from 0deg, rgba(107, 212, 208, 0.18), rgba(232, 121, 182, 0.18), rgba(244, 199, 90, 0.18), rgba(107, 212, 208, 0.18));
    mix-blend-mode: screen;
    opacity: 0;
    z-index: 8000;
    transition: opacity 220ms ease;
}

.iridescence-overlay.flash {
    animation: page-iridesce 380ms ease-out;
}

@keyframes page-iridesce {
    0%   { opacity: 0; }
    35%  { opacity: 0.5; }
    100% { opacity: 0; }
}

/* ============================================================
   POP PARTICLES
   ============================================================ */

.pop-burst {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 60;
}

.pop-particle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 6px currentColor;
    animation: pop-fly 600ms ease-out forwards;
    will-change: transform, opacity;
}

@keyframes pop-fly {
    0%   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.4); opacity: 0; }
}

/* ============================================================
   ANIMATIONS — entrance & idle
   ============================================================ */

.bubble.is-spawn .bubble-skin {
    animation: bubble-spawn 700ms var(--ease-elastic) backwards;
}

@keyframes bubble-spawn {
    0%   { transform: scale(0); }
    70%  { transform: scale(1.06); }
    100% { transform: scale(1); }
}

.bubble.is-wiggle .bubble-skin {
    animation: bubble-wiggle 600ms ease-in-out;
}

@keyframes bubble-wiggle {
    0%   { transform: scale(1); }
    25%  { transform: scale(1.03); }
    60%  { transform: scale(0.98); }
    100% { transform: scale(1); }
}

.bubble.is-reform .bubble-skin {
    animation: bubble-reform 480ms var(--ease-elastic);
}

@keyframes bubble-reform {
    0%   { transform: scale(0); }
    65%  { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* When in focus (mini-bubble click), shimmer slightly */
.bubble.is-focus .bubble-rim {
    animation-duration: 10s;
    opacity: 1;
}

/* ============================================================
   GREETING / SIGNOUT custom arrangements (default uses data-x/y)
   ============================================================ */

.signout-arrangement,
.greeting-arrangement {
    position: relative;
    width: 100%;
    height: 100%;
}

/* ============================================================
   Reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    .bubble .bubble-skin {
        animation: bubble-pulse 5s ease-in-out infinite !important;
        transform: none !important;
    }
    @keyframes bubble-pulse {
        0%, 100% { opacity: 1; }
        50%      { opacity: 0.94; }
    }
    .bubble-rim { animation: none !important; opacity: 0.7 !important; }
    .bubble-faces { transition: opacity 200ms ease !important; }
    .bubble.is-flipped .bubble-face-front { opacity: 0; }
    .bubble.is-flipped .bubble-face-back  { opacity: 1; transform: rotateY(0) !important; }
    .ambience-dot { animation: none !important; }
    .cursor-trail { display: none; }
    .ledger-ribbon { animation: none !important; }
    .mixer-preview { animation: none !important; }
}

/* ============================================================
   Custom cursor over bubble (tweezer SVG)
   ============================================================ */

.bubble {
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'><path d='M11 3 L9 18 L12 21 L15 18 L13 3' fill='none' stroke='%232A2540' stroke-width='1.8' stroke-linejoin='round' stroke-linecap='round'/></svg>") 12 12, grab;
}
