/* www.bubblepopping.space — shared styles */

:root {
  --bg: #000000;
  --footer-text: rgba(255, 255, 255, 0.32);
  --footer-text-hover: rgba(255, 255, 255, 0.7);
  --watermark-text: rgba(255, 255, 255, 0.18);
  --page-text: rgba(255, 255, 255, 0.72);
  --page-heading: rgba(255, 255, 255, 0.92);
  --page-link: rgba(255, 255, 255, 0.85);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  height: 100%;
}

body {
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Canvas (index) ---------- */

body.canvas-body {
  position: relative;
  min-height: 100dvh;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

/* Empty spacer so the AI disclosure sits just below the fold —
   reachable, but out of the way of the bubbles. */
.scroll-spacer {
  height: 125vh;
  pointer-events: none;
}

.ai-disclosure {
  position: relative;
  z-index: 2;
  background: var(--bg);
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 24px 120px;
  user-select: text;
  -webkit-user-select: text;
}

.ai-disclosure h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--page-heading);
  margin: 0 0 14px;
}

.ai-disclosure p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--page-text);
  margin: 0;
}

.ai-disclosure a {
  color: var(--page-link);
}

.ai-disclosure a:hover,
.ai-disclosure a:focus-visible {
  color: var(--footer-text-hover);
}

#bubble-field {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 1;
}

/* ---------- Music toggle (persistent UI, not a pop-able bubble) ---------- */

.music-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 5;
  width: 58px;
  height: 58px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  outline: none;
  background-color: transparent;
  background-clip: padding-box;
  background:
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.5) 5%, rgba(255, 255, 255, 0) 13%),
    radial-gradient(circle at 68% 72%, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 8%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.05) 50%, rgba(210, 235, 255, 0.28) 76%, rgba(255, 255, 255, 0.45) 88%, rgba(255, 255, 255, 0.05) 100%);
  box-shadow:
    inset 0 0 6px rgba(255, 255, 255, 0.25),
    0 0 16px rgba(255, 255, 255, 0.08);
  transition: box-shadow 200ms ease;
}

.music-toggle:focus-visible {
  box-shadow:
    inset 0 0 6px rgba(255, 255, 255, 0.25),
    0 0 0 2px rgba(255, 255, 255, 0.4);
}

.music-icon {
  font-size: 22px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.55);
  user-select: none;
  transition: color 200ms ease, filter 200ms ease;
}

.music-toggle.playing .music-icon {
  color: rgba(255, 255, 255, 0.92);
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.5));
}

.bubble {
  position: absolute;
  top: -12vh;
  border-radius: 50%;
  cursor: pointer;
  touch-action: manipulation;
  background:
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.5) 5%, rgba(255, 255, 255, 0) 13%),
    radial-gradient(circle at 68% 72%, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 8%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.03) 50%, rgba(210, 235, 255, 0.28) 76%, rgba(255, 255, 255, 0.45) 88%, rgba(255, 255, 255, 0.05) 100%);
  box-shadow:
    inset 0 0 6px rgba(255, 255, 255, 0.25),
    0 0 16px rgba(255, 255, 255, 0.08);
  will-change: transform, opacity;
  animation-name: float;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

@keyframes float {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  8%   { opacity: var(--op, 0.85); }
  25%  { transform: translate(calc(var(--drift) * 0.5), 35vh) rotate(calc(var(--rotate) * 0.3)); }
  50%  { transform: translate(calc(var(--drift) * -0.6), 70vh) rotate(calc(var(--rotate) * -0.4)); }
  75%  { transform: translate(calc(var(--drift) * 0.8), 105vh) rotate(calc(var(--rotate) * 0.6)); }
  92%  { opacity: var(--op, 0.85); }
  100% { transform: translate(calc(var(--drift) * -0.3), 140vh) rotate(var(--rotate)); opacity: 0; }
}

.bubble.popping {
  animation: pop 220ms ease-out forwards;
}

@keyframes pop {
  0%   { transform: scale(1); opacity: 1; filter: blur(0); }
  55%  { transform: scale(1.35); opacity: 0.55; filter: blur(0.5px); }
  100% { transform: scale(1.7); opacity: 0; filter: blur(1px); }
}

.bubble.wobble {
  animation-name: float, wobble;
  animation-duration: var(--duration), 280ms;
  animation-timing-function: linear, ease-in-out;
  animation-fill-mode: forwards, both;
}

@keyframes wobble {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.45); }
}

@media (prefers-reduced-motion: reduce) {
  .bubble {
    animation-duration: 0.01ms !important;
  }
}

/* ---------- Footer (shared across all pages) ---------- */

.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 14px 16px 10px;
  text-align: center;
  pointer-events: none;
}

.site-footer * {
  pointer-events: auto;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.footer-nav a {
  color: var(--footer-text);
  text-decoration: none;
  transition: color 200ms ease;
  padding: 4px 2px;
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
  color: var(--footer-text-hover);
}

.footer-nav span {
  color: var(--watermark-text);
  font-size: 10px;
}

.watermark {
  margin: 6px 0 0;
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: var(--watermark-text);
}

/* ---------- Content pages (terms, privacy, contact, sitemap, whitepaper) ---------- */

body.page-body {
  padding: 64px 20px 140px;
  display: flex;
  justify-content: center;
}

.page-wrap {
  width: 100%;
  max-width: 640px;
}

.page-back {
  display: inline-block;
  margin-bottom: 28px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--footer-text);
  text-decoration: none;
}

.page-back:hover,
.page-back:focus-visible {
  color: var(--footer-text-hover);
}

.page-wrap h1 {
  font-size: 22px;
  font-weight: 500;
  color: var(--page-heading);
  margin: 0 0 6px;
}

.page-updated {
  font-size: 11px;
  color: var(--watermark-text);
  margin: 0 0 32px;
}

.page-wrap h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--page-heading);
  margin: 28px 0 8px;
}

.page-wrap p,
.page-wrap li {
  font-size: 14px;
  line-height: 1.7;
  color: var(--page-text);
}

.page-wrap ul {
  padding-left: 20px;
}

.page-wrap a {
  color: var(--page-link);
}

.page-wrap a:hover,
.page-wrap a:focus-visible {
  color: var(--footer-text-hover);
}

.sitemap-list {
  list-style: none;
  padding: 0;
}

.sitemap-list li {
  margin-bottom: 10px;
}
