/* ==========================================================================
   Mosaic experiment: full screen image, name at the top, instructions at the bottom, reset in the corner.
   ========================================================================== */

:root {
  --bg: #000000;
  --ink: #f5f5f7;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;

  box-sizing: border-box;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  height: 100svh;
  min-height: 420px;
  overflow: hidden;
  touch-action: pan-y;
  background: linear-gradient(160deg, #2a2c31, #121316);   /* shown only if the canvas can't draw */
}

#mosaic {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Soft shading at the top and bottom so the text stays readable. */
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0, rgba(0, 0, 0, 0) 120px),
    linear-gradient(to top, rgba(0, 0, 0, 0.4) 0, rgba(0, 0, 0, 0) 140px);
}

/* Your name, top center. It takes you back to the home page. */
.site-name {
  position: absolute;
  z-index: 3;
  top: max(env(safe-area-inset-top, 0px), 0px);
  left: 50%;
  transform: translateX(-50%);
  margin-top: clamp(18px, 2.4vw, 30px);
  padding: 6px 12px;
  color: #ffffff;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6), 0 0 18px rgba(0, 0, 0, 0.5);
  border-radius: 8px;
}
.site-name:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.site-name:focus-visible, .reset-btn:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.8); outline-offset: 3px; }

/* Instructions, bottom center. */
.hint {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: calc(clamp(20px, 2.4vw, 30px) + env(safe-area-inset-bottom, 0px) + 8px);
  margin: 0;
  padding: 0 84px;
  text-align: center;
  pointer-events: none;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6), 0 0 18px rgba(0, 0, 0, 0.5);
}

/* Reset, bottom right: a small translucent circle with a thin outline. */
.reset-btn {
  position: absolute;
  z-index: 3;
  right: clamp(16px, 2.4vw, 28px);
  bottom: calc(clamp(16px, 2.4vw, 28px) + env(safe-area-inset-bottom, 0px));
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  background: rgba(34, 34, 38, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.reset-btn svg { width: 16px; height: 16px; }
.reset-btn:hover { background: rgba(60, 60, 66, 0.55); border-color: rgba(255, 255, 255, 0.38); transform: scale(1.06); }

/* Embedded in the frame on the home page (?embed): the page around it supplies all of this. */
.embed .site-name, .embed .hint, .embed .reset-btn { display: none; }
.embed .stage { min-height: 0; }

@media (prefers-reduced-motion: reduce) {
  .reset-btn { transition: none; }
}
