/* The Gleam Points program: gleam.html, points.html and invite.html. The rest of
   the site is quiet white; the program runs the beam at full power. Ink bands
   alternate with paper, section breaks are cut on angles and curves, numbers roll
   like an arcade odometer and land with a ping. See DESIGN.md § Points program. */

.program {
  --ink: #0A0A0A;
  --ink-2: #131313;
  --ink-line: #262626;
  --on-ink: #FFFFFF;
  --on-ink-muted: #A3A3A3;
  --paper: #F7F7F7;
  --beam-stack: linear-gradient(180deg,
    var(--beam-red) 0 20%, var(--beam-purple) 20% 40%, var(--beam-sky) 40% 60%,
    var(--beam-yellow) 60% 80%, var(--beam-green) 80% 100%);
  --beam-run: linear-gradient(90deg,
    var(--beam-red) 0 20%, var(--beam-purple) 20% 40%, var(--beam-sky) 40% 60%,
    var(--beam-yellow) 60% 80%, var(--beam-green) 80% 100%);
  background: var(--ink);
}

/* Header and footer sit on ink */

.program .site-header { background: rgba(10, 10, 10, .62); }
.program .wordmark { color: var(--on-ink); }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .program .site-header { background: rgba(10, 10, 10, .95); }
}

@media (prefers-reduced-transparency: reduce) {
  .program .site-header { background: var(--ink); }
}

.program .site-footer { background: var(--ink); border-top-color: var(--ink-line); color: var(--on-ink-muted); }
.program .site-footer a { color: var(--on-ink-muted); }
.program .site-footer a:hover { color: var(--on-ink); }
.program .site-footer .footer-mark { color: var(--on-ink); }

.program :focus-visible { outline-color: currentColor; }

.ink { color: var(--on-ink); background: var(--ink); }
.ink .button { background: var(--on-ink); color: var(--ink); }
.ink .button:hover { background: #E8E8E8; }
.ink .small, .ink .line { color: var(--on-ink-muted); }
.ink .small a, .ink .small strong, .ink .line strong { color: var(--on-ink); }

/* Section breaks. Each SVG stretches to the full width; its strokes keep their
   weight so the beam stays a hairline at any aspect ratio. */

.cut { position: relative; display: block; height: clamp(56px, 10vw, 160px); margin: -1px 0; }
.cut svg { display: block; width: 100%; height: 100%; overflow: visible; }
.cut line, .cut path[stroke] { stroke-width: 2; vector-effect: non-scaling-stroke; }
/* Each cut is backed by the band it meets at the seam, so no subpixel hairline shows */
.cut-angle { background: linear-gradient(var(--ink) 3px, var(--paper) 3px); }
.cut-curve { background: linear-gradient(var(--paper) calc(100% - 3px), #fff calc(100% - 3px)); height: clamp(64px, 12vw, 200px); }
.cut-curve-dark { background: linear-gradient(var(--paper) calc(100% - 3px), var(--ink) calc(100% - 3px)); }
.cut-fade { height: clamp(140px, 28vh, 300px); background: linear-gradient(180deg, #fff, var(--ink)); }

/* Odometer: one rolling column per digit, with an eleventh 0 so 9 rolls forward */

.gc-int { display: inline-flex; }
.od { display: inline-block; height: 1em; clip-path: inset(0 -.3em); }
.od-s { display: block; transition: transform .46s cubic-bezier(.3, 1.45, .45, 1); }
.od-s > span { display: block; height: 1em; }
.od-s.snap { transition: none; }
.od-sep { display: inline-block; width: .28em; }

/* A number landing: punch, a frame of beam-colour split, and a +1 that floats off */

@keyframes gc-land {
  0% { transform: none; }
  16% { transform: translateY(-3%) scale(1.13) rotate(-2.2deg); }
  42% { transform: scale(.975) rotate(.7deg); }
  68% { transform: scale(1.015); }
  100% { transform: none; }
}

@keyframes gc-split {
  0% { color: var(--hit); text-shadow: -.06em 0 var(--beam-red), .06em 0 var(--beam-sky), 0 .03em var(--beam-green); }
  50% { color: var(--hit); text-shadow: .03em 0 var(--beam-purple), -.03em 0 var(--beam-yellow); }
  100% { color: var(--on-ink); text-shadow: none; }
}

@keyframes gc-plus {
  0% { opacity: 0; transform: translateY(.5em) scale(.5); }
  14% { opacity: 1; transform: translateY(0) scale(1.25); }
  30% { transform: translateY(-.25em) scale(1); }
  100% { opacity: 0; transform: translateY(-1.8em); }
}

/* Sound toggle: always on screen. Sound starts off each visit, since
   browsers need a click before they'll play, so the toggle is also the way
   in. It glows whenever a sound plays silently, to invite that click. */

.v-sound {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 15px 0 12px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  background: rgba(10, 10, 10, .78);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--on-ink);
  font: 500 .8125rem/1 var(--sans);
  cursor: pointer;
}
.v-sound[hidden] { display: none; }
.v-sound:hover { background: rgba(10, 10, 10, .92); }
.v-sound:focus-visible { outline: 2px solid var(--beam-sky); outline-offset: 3px; border-radius: 999px; }
.v-sound[aria-pressed="true"] .v-sound-off, .v-sound[aria-pressed="false"] .v-sound-on { display: none; }
.v-sound[aria-pressed="false"] { color: var(--on-ink-muted); }
.v-sound.hint { animation: v-sound-hint 1.1s ease-out; }

@keyframes v-sound-hint {
  0% { color: var(--on-ink-muted); border-color: rgba(255, 255, 255, .18); box-shadow: 0 0 0 0 transparent; }
  15% { color: var(--on-ink); border-color: var(--beam-sky); box-shadow: 0 0 18px 2px color-mix(in srgb, var(--beam-sky) 45%, transparent); }
  100% { color: var(--on-ink-muted); border-color: rgba(255, 255, 255, .18); box-shadow: 0 0 0 0 transparent; }
}

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

/* Per-visitor CTAs (pages.js); the attribute must beat a block's own display */
[data-for][hidden] { display: none; }
