/* =============================================================================
   motion.css — the "WOW that holds the visitor".
   EVERYTHING here is opt-out by default: wrapped in prefers-reduced-motion:no-preference.
============================================================================= */

/* Reveals: default visible (JS adds .in). If JS/IO missing, .reveal still shows. */
.reveal { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {

  /* Scroll reveal: fade + rise */
  .reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.3,1); }
  .reveal.in { opacity: 1; transform: none; }

  /* Night-mode spinning disco ball on the hero */
  .disco-ball {
    position: absolute; top: 8%; left: 50%; margin-left: -34px; z-index: 2;
    width: 68px; height: 68px; border-radius: 50%;
    background:
      radial-gradient(circle at 35% 30%, #fff, #cfc9ba 45%, #6f6a5c 100%);
    box-shadow: 0 0 40px var(--glow), 0 0 90px var(--glow);
    background-size: 12px 12px;
    background-image:
      radial-gradient(circle at 35% 30%, #fff, #cfc9ba 45%, #6f6a5c 100%),
      repeating-linear-gradient(0deg, rgba(0,0,0,.25) 0 1px, transparent 1px 12px),
      repeating-linear-gradient(90deg, rgba(0,0,0,.25) 0 1px, transparent 1px 12px);
    animation: dm-spin 8s linear infinite, dm-bob 5s ease-in-out infinite;
    opacity: .9;
  }
  .disco-ball::before {
    content: ""; position: absolute; top: -60px; left: 50%; width: 2px; height: 60px;
    background: linear-gradient(var(--accent), transparent); transform: translateX(-50%);
  }
  .disco-ball span {
    position: absolute; inset: -40vmax; z-index: -1; pointer-events: none;
    background: repeating-conic-gradient(from 0deg, transparent 0 14deg, var(--glow) 14deg 18deg);
    opacity: .12; animation: dm-sweep 14s linear infinite;
  }
  @keyframes dm-spin { to { transform: rotate(360deg); } }
  @keyframes dm-bob  { 0%,100% { top: 8%; } 50% { top: 10%; } }
  @keyframes dm-sweep { to { transform: rotate(360deg); } }

  /* Scroll cue bounce */
  .scroll-cue { animation: dm-cue 1.8s ease-in-out infinite; }
  @keyframes dm-cue { 0%,100% { transform: translateX(-50%) translateY(0); opacity: .8; } 50% { transform: translateX(-50%) translateY(6px); opacity: 1; } }

  /* Day-mode aged-paper grain */
  [data-theme="day"] body::after {
    content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 1; mix-blend-mode: multiply;
    opacity: var(--grain-opacity);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
  }

  /* Brand underline draw-on under section titles when revealed */
  .section-title { position: relative; }

  /* Vinyl-record hover spin on gallery + archive thumbs */
  .gal-item:hover .g-img { animation: none; }
  .archive-item:hover { animation: dm-vinyl .8s ease; }
  @keyframes dm-vinyl { from { transform: scale(1.04) rotate(-4deg); } to { transform: scale(1.04) rotate(0deg); } }

  /* Card lift already in layout; add subtle accent pulse on book button */
  .book-btn { position: relative; }
  .book-btn::after {
    content: ""; position: absolute; inset: -2px; border-radius: 999px; z-index: -1;
    box-shadow: 0 0 0 0 var(--glow); animation: dm-pulse 3.2s ease-out infinite;
  }
  @keyframes dm-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 70%,100% { box-shadow: 0 0 0 14px transparent; } }
}

/* When reduced motion IS preferred: hide the spinning ball entirely, show a static stamp instead */
@media (prefers-reduced-motion: reduce) {
  .disco-ball { display: none; }
}
/* Day mode always shows the static brand stamp rather than the ball */
[data-theme="day"] .disco-ball { display: none; }
