/* shared/site/background.css -- the page's atmosphere layer.
 *
 * The engine paints a full-viewport scene, so the page's own opaque body colour is cleared and the
 * layer sits behind ALL content (negative z-index) instead of fighting the page's stacking. That is
 * deliberate: these landing pages are independent, self-contained documents with their own fixed
 * headers and overlays, and a negative-z layer cannot cover or break any of them.
 *
 * STACK, from the back:
 *   .atmos-scene   the base scene + the product's motif (it falls in, it parallaxes, it inverts)
 *   .atmos-veil    a readability wash: the page's measured text colours sit on this, not on raw art
 *   .atmos-hidden  the sentence and marks that exist only inside the lamp's light
 *   .atmos-night   the dark, with a hole where the pointer is
 *   .atmos-event   the once-a-visit surprise, above the dark so it can be seen
 *
 * Nothing here may receive a pointer or be read out loud: the root carries aria-hidden and
 * pointer-events: none, and every animation is cancelled by prefers-reduced-motion.
 */
html,
body { background: transparent !important; }

#site-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  /* the lamp's position, written by background.js as percentages */
  --lx: 50%;
  --ly: 40%;
  background: #070a0e;
}
#site-bg > svg,
#site-bg > div { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------------------------------------------------------------- the fall ---- */

#site-bg.atmos-enter .atmos-lyr {
  animation: atmos-fall 1250ms cubic-bezier(.16, 1, .3, 1) both;
  animation-delay: var(--d, 0ms);
}
@keyframes atmos-fall {
  from { transform: translateY(var(--drop, -80px)); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
#site-bg .atmos-plx { will-change: transform; }

/* ------------------------------------------------------------- readability ---- */

.atmos-veil {
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(8, 11, 15, .25) 0%, rgba(8, 11, 15, .55) 55%, rgba(8, 11, 15, .82) 100%),
    linear-gradient(180deg, rgba(8, 11, 15, .30) 0%, rgba(8, 11, 15, .52) 45%, rgba(8, 11, 15, .86) 100%);
}

/* The hub is a LIST of twenty-one products and its own measured text colours sit directly on this
 * layer, with no card behind them. Its ground is therefore a whisper: the studio's scene is there
 * to be noticed at the edges, not to compete with the catalogue. */
#site-bg[data-mood="studio"] .atmos-veil {
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(10, 12, 15, .62) 0%, rgba(10, 12, 15, .80) 55%, rgba(10, 12, 15, .90) 100%),
    linear-gradient(180deg, rgba(10, 12, 15, .74) 0%, rgba(10, 12, 15, .84) 45%, rgba(10, 12, 15, .93) 100%);
}

/* ------------------------------------------------------------------ the lamp ---- */

.atmos-hidden {
  opacity: 0;
  transition: opacity .5s ease;
  -webkit-mask-image: radial-gradient(circle 210px at var(--lx) var(--ly), #000 0%, rgba(0, 0, 0, .9) 38%, transparent 74%);
  mask-image: radial-gradient(circle 210px at var(--lx) var(--ly), #000 0%, rgba(0, 0, 0, .9) 38%, transparent 74%);
}
.atmos-night {
  opacity: 0;
  transition: opacity .55s ease;
  background: radial-gradient(circle 280px at var(--lx) var(--ly), rgba(2, 5, 8, 0) 0%, rgba(2, 5, 8, .55) 46%, rgba(2, 5, 8, .93) 82%);
}
#site-bg.atmos-is-night .atmos-hidden { opacity: 1; }
#site-bg.atmos-is-night .atmos-night { opacity: 1; }
#site-bg.atmos-is-night .atmos-scene { filter: brightness(.42) saturate(.9); }

/* ---------------------------------------------------------------- the answer ---- */
/* The hidden line says "hold the light here", so holding it must DO something visible: a rule
 * fills under the words while the pointer rests, and the page's reply replaces the instruction.
 * Both states are driven by classes the engine adds, so a broken hold is visible in the DOM. */
.atmos-hidden .atmos-prompt-line,
.atmos-hidden .atmos-prompt-sub,
.atmos-hidden .atmos-reply { transition: opacity .35s ease; }
.atmos-hidden .atmos-reply { opacity: 0; }
#site-bg.atmos-found .atmos-hidden .atmos-prompt-line,
#site-bg.atmos-found .atmos-hidden .atmos-prompt-sub { opacity: 0; }
#site-bg.atmos-found .atmos-hidden .atmos-reply { opacity: 1; }
.atmos-hold-bar { stroke-dashoffset: 180; transition: stroke-dashoffset .25s ease; }
#site-bg.atmos-holding .atmos-hold-bar { stroke-dashoffset: 0; transition: stroke-dashoffset 1.2s linear; }
#site-bg.atmos-found .atmos-hold-bar { opacity: 0; }

/* ---------------------------------------------------------------- the offer ------ */
/* THE THIRD BEAT. The reply is the secret; this is what the secret was for. It appears only while
 * the light is still resting on the line, it uses the page's OWN tokens so it belongs to the page,
 * and it carries the page's OWN lede and next step -- nothing is invented here. It is above the
 * content on purpose: it is transient, dismissible, and the one moment the reader is looking
 * exactly where the page wants them to look. */
#site-offer {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147483000;
  width: min(350px, calc(100vw - 32px));
  padding: 16px 18px 15px;
  background: var(--surface, #141a23);
  color: var(--text, #eceff3);
  border: 1px solid var(--line, #232c38);
  border-radius: var(--radius, 14px);
  box-shadow: 0 18px 50px rgba(8, 11, 15, .38);
  font: 400 15px/1.5 var(--font-sans, system-ui, -apple-system, "Segoe UI", sans-serif);
  animation: site-offer-in .35s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes site-offer-in {
  from { transform: translateY(14px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.site-offer__eyebrow {
  margin: 0 0 6px;
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent, #f2a93b);
}
.site-offer__text { margin: 0 0 13px; color: var(--text, #eceff3); }
.site-offer__cta {
  display: inline-block;
  min-height: 44px;
  padding: .55rem .95rem;
  border: 1px solid var(--accent, #f2a93b);
  border-radius: 999px;
  color: var(--accent, #f2a93b);
  font-weight: 600;
  text-decoration: none;
}
.site-offer__cta:hover,
.site-offer__cta:focus-visible { background: var(--accent, #f2a93b); color: var(--bg, #0a0c0f); }
.site-offer__close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted, #a3adb8);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.site-offer__close:hover,
.site-offer__close:focus-visible { color: var(--text, #eceff3); background: var(--bg-soft, #0e1218); }
@media (prefers-reduced-motion: reduce) { #site-offer { animation: none; } }

/* ------------------------------------------------------------- the paper page ---- */
/* Beta is the one page with a LIGHT ground (its own paper.css carries dark text and pale
 * surfaces). The metaphor has to invert with the tone: the lamp is not a light in the dark, it is
 * the unwashed sheet inside a dusk. So the veil turns pale, the night wash is a warm shadow rather
 * than a blackout, and the scene is not dimmed -- the hidden ink lives on the bright patch. */
#site-bg.atmos-tone-light { background: #f7f2e8; }
#site-bg.atmos-tone-light .atmos-veil {
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(247, 242, 232, .10) 0%, rgba(247, 242, 232, .34) 60%, rgba(247, 242, 232, .52) 100%),
    linear-gradient(180deg, rgba(247, 242, 232, .12) 0%, rgba(247, 242, 232, .34) 45%, rgba(247, 242, 232, .58) 100%);
}
#site-bg.atmos-tone-light .atmos-night {
  background: radial-gradient(circle 300px at var(--lx) var(--ly), rgba(58, 44, 26, 0) 0%, rgba(58, 44, 26, .10) 52%, rgba(58, 44, 26, .30) 88%);
}
#site-bg.atmos-tone-light.atmos-is-night .atmos-scene { filter: none; }
#site-bg.atmos-tone-light .atmos-hold-bar { stroke-dashoffset: 180; }

/* ------------------------------------------------------------- the negative ----- */

.atmos-scene { transition: filter .55s ease; }
.atmos-scene.atmos-negative { filter: invert(1) hue-rotate(180deg) saturate(1.15) brightness(1.02); }

/* ---------------------------------------------------------------- the surprises -- */

.atmos-burst { animation: atmos-burst 5s ease forwards; }
@keyframes atmos-burst {
  0%   { opacity: 0; }
  12%  { opacity: 1; }
  80%  { opacity: .9; }
  100% { opacity: 0; }
}
.atmos-burst--meteor { animation: atmos-meteor 2.2s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes atmos-meteor {
  0%   { transform: translate(120px, -80px); opacity: 0; }
  12%  { opacity: 1; }
  100% { transform: translate(-260px, 220px); opacity: 0; }
}
.atmos-burst--firefly circle { animation: atmos-firefly 3.4s ease-in-out infinite; }
.atmos-burst--firefly circle:nth-child(2n) { animation-delay: .7s; }
.atmos-burst--firefly circle:nth-child(3n) { animation-delay: 1.4s; }
@keyframes atmos-firefly {
  0%, 100% { opacity: .1; }
  50% { opacity: .85; }
}
.atmos-burst--moth .atmos-moth { animation: atmos-moth 4.6s ease-in-out infinite; }
.atmos-burst--moth .atmos-moth:nth-child(2) { animation-delay: .9s; }
.atmos-burst--moth .atmos-moth:nth-child(3) { animation-delay: 1.8s; }
@keyframes atmos-moth {
  0%   { transform: translate(300px, 320px) rotate(-8deg); opacity: 0; }
  20%  { opacity: .9; }
  50%  { transform: translate(620px, 260px) rotate(6deg); }
  100% { transform: translate(900px, 360px) rotate(-4deg); opacity: 0; }
}
.atmos-burst--whale { animation: atmos-whale 6s ease-in-out forwards; }
@keyframes atmos-whale {
  0%   { transform: translate(-420px, 0); opacity: 0; }
  20%  { opacity: .9; }
  80%  { opacity: .9; }
  100% { transform: translate(520px, 0); opacity: 0; }
}
.atmos-burst--orbits { animation: atmos-orbits 5s ease forwards; }
@keyframes atmos-orbits {
  0%   { transform: rotate(0deg); opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: rotate(24deg); opacity: 0; }
}
.atmos-burst--flash rect { animation: atmos-flash 1.4s ease-out forwards; }
@keyframes atmos-flash {
  0%   { opacity: 0; }
  18%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ------------------------------------------------------------- reduced motion --- */

@media (prefers-reduced-motion: reduce) {
  #site-bg .atmos-lyr,
  #site-bg.atmos-enter .atmos-lyr,
  .atmos-burst,
  .atmos-burst--meteor,
  .atmos-burst--whale,
  .atmos-burst--orbits,
  .atmos-burst--flash rect,
  .atmos-burst--firefly circle,
  .atmos-burst--moth .atmos-moth {
    animation: none !important;
  }
  #site-bg .atmos-plx { transform: none !important; }
  .atmos-hidden,
  .atmos-night { display: none; }
  .atmos-scene { transition: none; }
  #site-bg.atmos-is-night .atmos-scene { filter: none; }
}

/* A page printed on paper does not need a moving sky. */
@media print {
  #site-bg { display: none; }
}

/* ---------------------------------------------------------------------------
   2026-11-28 — THE VECTORFORGE OPTIONS BAR.
   The hub at sheehangillis.com has a top options bar. The 3fts landing pages get
   the same affordance, scoped to the atmosphere behind the page: a Scene menu
   built by background.js. The page's <meta name="page-background"> is never
   rewritten, and its own mood is the first option.
   The bar is dark and self-contained because it has to be legible over 26
   different atmospheres and page styles.
   --------------------------------------------------------------------------- */
#site-options.so-landing {
  position: relative;
  z-index: 60;
  background: #040c12;
  border-bottom: 1px solid #16232e;
  color: #b9c7d4;
  font: 13px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
#site-options.so-landing .so-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 22px;
}
#site-options.so-landing .so-title {
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-size: 11px;
  color: #6f8798;
}
#site-options.so-landing .so-field { display: flex; align-items: center; gap: 7px; min-width: 0; }
#site-options.so-landing label { color: #6f8798; font-size: 12px; }
#site-options.so-landing select {
  background: #0b1822;
  color: #e6eef6;
  border: 1px solid #24333f;
  border-radius: 8px;
  padding: 5px 8px;
  font: inherit;
  font-size: 12.5px;
  color-scheme: dark;
  max-width: min(52vw, 430px);
}
#site-options.so-landing select:hover { border-color: #4cc2ff; }
#site-options.so-landing select:focus-visible {
  outline: 2px solid #4cc2ff;
  outline-offset: 2px;
}
#site-options.so-landing .so-note {
  color: #5d7484;
  font-size: 11.5px;
  margin-left: auto;
}
@media (max-width: 760px) {
  #site-options.so-landing .so-wrap { padding: 8px 14px; gap: 10px; }
  #site-options.so-landing .so-note { display: none; }
  #site-options.so-landing select { max-width: 48vw; }
}
@media print {
  #site-options.so-landing { display: none; }
}
