/* SOB homepage daycycle (pairs with daycycle.js). Decorative only.
   Two hosts:
   - full-bleed layout: any element with [data-daycycle] (fixed behind the page; geometry via --dc-* below);
   - legacy 800x620 stage: .stage-card .bg-layer (beach.gif stays as the no-JS fallback). */

/* ---------- full-bleed host ---------- */
[data-daycycle] {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #050b16;
  /* desktop: content column on the left, so the sun/moon arc runs across the right half */
  --dc-horizon: 0.64;
  --dc-arc-x0: 0.52;
  /* r3: set end >= 80 px from the right edge at 1280 (QA r2: dusk sun at the edge) */
  --dc-arc-x1: 0.9;
  /* r2: highest point well below the sticky header so noon rays are never clipped by the nav */
  --dc-sky-top: 0.19;
}

@media (max-width: 759px) {
  /* phone: the sky is the top band above the content sheet; the arc spans the full width */
  [data-daycycle] {
    /* r2: horizon sits ~45px above the content sheet, so a rising/setting sun is on open sea, not on the sheet edge;
       the arc starts below the header; the readout lives inside the sheet, never over this band */
    --dc-horizon: 0.30;
    --dc-arc-x0: 0.1;
    --dc-arc-x1: 0.9;
    --dc-sky-top: 0.135;
  }
}

/* ---------- legacy stage host ---------- */
.stage-card.dc-on .bg-layer {
  background-image: none;
  background-color: #03060d;
  pointer-events: none;
  overflow: hidden;
}

.dc-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  animation: dc-in 1.2s ease-out both;
}

@keyframes dc-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Legacy stage only: contrast scrim behind the centred text column. --dc-scrim (0.30-0.86) is set by daycycle.js. */
.stage-card.dc-on .bg-overlay {
  background:
    radial-gradient(ellipse 46% 50% at 50% 52%,
      rgba(3, 8, 18, var(--dc-scrim, 0.45)) 0%,
      rgba(3, 8, 18, calc(var(--dc-scrim, 0.45) * 0.85)) 55%,
      rgba(3, 8, 18, calc(var(--dc-scrim, 0.45) * 0.35)) 85%,
      rgba(3, 8, 18, 0) 100%);
  transition: background 2s linear;
}

@media (prefers-reduced-motion: reduce) {
  .dc-canvas { animation: none; }
  .stage-card.dc-on .bg-overlay { transition: none; }
}
