  * { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { height: 100%; overflow: hidden; }
  body {
    background: #efece4;
    font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  }
  #canvas { position: fixed; inset: 0; display: block; width: 100%; height: 100%; cursor: grab; }
  #canvas.dragging { cursor: grabbing; }

  .back-btn {
    position: fixed;
    top: 28px;
    right: 28px;
    z-index: 50;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(20, 20, 26, 0.85);
    color: #f3f1ec;
    border: 0.5px solid rgba(243, 241, 236, 0.2);
    border-radius: 999px;
    font: inherit;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.4s ease 0.4s, transform 0.4s ease 0.4s, background 0.2s ease;
    backdrop-filter: blur(8px);
  }
  .back-btn.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }
  .back-btn:hover { background: rgba(20, 20, 26, 0.95); }
  .back-btn .arrow { font-size: 14px; line-height: 1; }

  /* ============================================================
     DISCO MODE TOGGLE — sun/moon icon, top-right
     ============================================================ */
  .disco-btn {
    position: fixed;
    top: 28px;
    left: 28px;
    z-index: 51;
    width: 44px;
    height: 44px;
    background: rgba(20, 20, 26, 0.85);
    border: 0.5px solid rgba(243, 241, 236, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease, transform 0.3s ease;
    backdrop-filter: blur(8px);
  }
  .disco-btn:hover { background: rgba(20, 20, 26, 0.95); transform: scale(1.05); }
  .disco-btn svg { width: 20px; height: 20px; color: #f3f1ec; transition: opacity 0.3s ease, transform 0.4s ease; }
  /* Toggle icon visibility */
  .disco-btn .icon-sun  { display: block; }
  .disco-btn .icon-moon { display: none; }
  body.disco-mode .disco-btn .icon-sun  { display: none; }
  body.disco-mode .disco-btn .icon-moon { display: block; }

  /* Background transition for disco mode */
  body {
    transition: background-color 0.8s ease;
  }
  body.disco-mode {
    background-color: #000000;
  }
  /* In disco mode the title text becomes lighter against the dark bg */
  body.disco-mode .work-title { color: #f3f1ec; }
  body.disco-mode .work-title em { color: #8a7da0; }

  /* ============================================================
     FLOOR REFLECTIONS — sharp little light dots, like a real
     disco ball casting reflections on the walls. Mostly white
     with subtle color, very small, lots of them.
     ============================================================ */
  .floor-spots {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.8s ease;
  }
  body.disco-mode .floor-spots { opacity: 1; }
  .spot {
    position: absolute;
    width: 22px;
    height: 22px;
    margin-left: -11px;
    margin-top: -11px;
    border-radius: 50%;
    background: radial-gradient(circle, currentColor 0%, currentColor 25%, transparent 70%);
    mix-blend-mode: screen;
    will-change: transform, opacity;
    /* Soft halo around each dot for the "light bleeding through air" look */
    filter: blur(1.5px);
  }

  /* ============================================================
     BALL GLOW — multiple animated layers for a real club feel:
     - Strong central purple/blue spotlight on the ball
     - Magenta beam from upper-left
     - Cyan beam from upper-right
     - Warm amber wash from below
     All layers slowly drift and pulse via @keyframes.
     ============================================================ */
  .ball-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.8s ease;
  }
  body.disco-mode .ball-glow { opacity: 1; }

  /* Each layer is its own div for independent animation */
  .glow-layer {
    position: absolute;
    inset: -10%;             /* overflow viewport so edges aren't visible */
    mix-blend-mode: screen;
  }

  /* Central spot — strong purple/blue spotlight straight on the ball */
  .glow-center {
    background: radial-gradient(circle at 50% 50%,
      rgba(160, 100, 255, 0.55) 0%,
      rgba(80, 120, 255, 0.40) 12%,
      rgba(60, 60, 180, 0.20) 28%,
      transparent 55%);
    animation: pulse-center 4s ease-in-out infinite;
  }

  /* Magenta/pink beam from upper-left */
  .glow-magenta {
    background: radial-gradient(ellipse 70% 90% at 20% 20%,
      rgba(255, 60, 180, 0.45) 0%,
      rgba(220, 40, 200, 0.22) 20%,
      transparent 50%);
    animation: drift-magenta 6s ease-in-out infinite;
  }

  /* Cyan beam from upper-right */
  .glow-cyan {
    background: radial-gradient(ellipse 70% 90% at 80% 25%,
      rgba(80, 220, 255, 0.40) 0%,
      rgba(60, 180, 255, 0.20) 22%,
      transparent 52%);
    animation: drift-cyan 7s ease-in-out infinite;
  }

  /* Warm amber wash from below */
  .glow-amber {
    background: radial-gradient(ellipse 90% 60% at 50% 95%,
      rgba(255, 160, 60, 0.30) 0%,
      rgba(255, 100, 40, 0.15) 25%,
      transparent 55%);
    animation: pulse-amber 5s ease-in-out infinite;
  }

  @keyframes pulse-center {
    0%, 100% { opacity: 0.85; transform: scale(1.0); }
    50%      { opacity: 1.0;  transform: scale(1.08); }
  }
  @keyframes drift-magenta {
    0%, 100% { transform: translate(0, 0)     scale(1.0); opacity: 0.75; }
    33%      { transform: translate(8%, -4%)  scale(1.1); opacity: 0.95; }
    66%      { transform: translate(-4%, 6%)  scale(0.95); opacity: 0.7; }
  }
  @keyframes drift-cyan {
    0%, 100% { transform: translate(0, 0)     scale(1.0); opacity: 0.75; }
    50%      { transform: translate(-6%, 4%)  scale(1.12); opacity: 1.0; }
  }
  @keyframes pulse-amber {
    0%, 100% { opacity: 0.5; }
    50%      { opacity: 0.9; }
  }

  /* ============================================================
     PROJECT CARDS (HTML overlay)
     ============================================================ */
  .card {
    position: fixed;
    width: 220px;
    height: 140px;
    border-radius: 5px;
    padding: 16px 18px;
    display: flex; flex-direction: column; justify-content: space-between;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    left: 50%; top: 50%;
    margin-left: -110px;
    margin-top: -70px;
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity, filter;
    box-shadow: 0 14px 32px rgba(0,0,0,0.22), 0 2px 4px rgba(0,0,0,0.12);
    transition: box-shadow 0.3s ease, filter 0.35s ease;
  }
  .card.visible { pointer-events: auto; }
  .cards-blur .card:not(:hover) { filter: blur(6px); }
  .card:hover {
    box-shadow: 0 22px 50px rgba(0,0,0,0.36), 0 3px 8px rgba(0,0,0,0.2);
  }
  /* Placeholder layout — centered large number, small label below */
  .card.placeholder {
    align-items: center;
    justify-content: center;
    gap: 4px;
  }
  .card.placeholder .placeholder-num {
    font-family: Georgia, serif;
    font-size: 44px;
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 1;
  }
  .card.placeholder .placeholder-label {
    font-size: 9px;
    letter-spacing: 0.22em;
    opacity: 0.7;
  }
  .card .num {
    font-size: 10px;
    letter-spacing: 0.2em;
    opacity: 0.75;
    font-variant-numeric: tabular-nums;
  }
  .card .title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 21px;
    line-height: 1.05;
    letter-spacing: -0.01em;
    margin-top: auto;
  }
  .card .tag {
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.75;
    margin-top: 6px;
  }
  .card.light-text { color: #14141a; }
  .card.light-text .num,
  .card.light-text .tag { opacity: 0.7; }

  /* ============================================================
     CENTRAL "WORK" TITLE — appears after explosion completes
     ============================================================ */
  .work-title {
    position: fixed;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 400;
    font-size: clamp(64px, 11vw, 180px);
    line-height: 0.9;
    letter-spacing: -0.025em;
    color: #14141a;
    pointer-events: none;
    opacity: 0;
    /* z-index 50 = midpoint of card z-index range (10-100). Cards in front of
       the title (closer to camera) get z-index > 50 in JS and appear on top;
       cards behind get z-index < 50 and are covered by the title. */
    z-index: 50;
    text-align: center;
    transition: opacity 0.8s ease;
    white-space: nowrap;
  }
  .work-title.visible { opacity: 1; }
  .work-title em {
    font-style: italic;
    color: #888;
  }
