/* nacits — not a cloud in the sky
   A surrealist weather report. The sky follows your local time;
   the clouds follow no one's instructions. */

:root {
  /* defaults: a noon sky, in case javascript is having a lie-in */
  --sky-top: #5ba3d8;
  --sky-mid: #97c6e9;
  --sky-bot: #d9ecf6;
  --cloud-rgb: 255, 255, 255;
  --cloud-shade-rgb: 197, 216, 236;
  --sun-rgb: 255, 250, 225;
  --ink: #2f3f5a;
  --serif: "Cormorant Garamond", "Cormorant", Garamond, Georgia, serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

/* the gradient lives on html so iOS Safari tints its status bar and
   toolbars with the sky — the blue must reach the edges of the phone */
html {
  background: linear-gradient(to bottom, var(--sky-top), var(--sky-mid) 55%, var(--sky-bot));
}

body {
  font-family: var(--serif);
  color: var(--ink);
  background: linear-gradient(to bottom, var(--sky-top), var(--sky-mid) 55%, var(--sky-bot));
  overflow: hidden;
  transition: color 4s linear;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- celestial furniture ---------- */

#stars {
  position: fixed; inset: 0;
  z-index: 1; pointer-events: none;
  opacity: 0;
  transition: opacity 4s linear;
}
#stars .star {
  position: absolute;
  width: 2px; height: 2px;
  border-radius: 50%;
  background: #f4f1e2;
  animation: twinkle 4s ease-in-out infinite alternate;
}
@keyframes twinkle {
  from { opacity: 0.25; }
  to   { opacity: 0.95; }
}

#sun, #moon {
  position: fixed;
  z-index: 1; pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity 4s linear;
}
/* a proper sun: a pale disc, a soft limb, and a wide honest halo.
   its colour warms toward gold at the edges of the day via --sun-rgb */
#sun {
  width: 42vmin; height: 42vmin;
  min-width: 220px; min-height: 220px;
  background: radial-gradient(circle,
    rgba(var(--sun-rgb), 0.98) 0 8.5%,
    rgba(var(--sun-rgb), 0.5) 11%,
    rgba(var(--sun-rgb), 0.18) 20%,
    rgba(var(--sun-rgb), 0.08) 33%,
    rgba(var(--sun-rgb), 0) 62%);
}
#sun::after {
  content: "";
  position: absolute; inset: -60%;
  background: radial-gradient(circle,
    rgba(var(--sun-rgb), 0.10) 0 28%,
    rgba(var(--sun-rgb), 0) 68%);
}
#moon {
  width: 9vmin; height: 9vmin;
  min-width: 44px; min-height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 62% 38%, #f7f4e6 0 58%, #ece7d2 100%);
  box-shadow:
    inset -10px 6px 0 rgba(190, 186, 165, 0.35),
    0 0 40px 12px rgba(244, 241, 226, 0.18);
}

/* ---------- the clouds that are not there ---------- */

#clouds { position: fixed; inset: 0; pointer-events: none; }

.cloud {
  position: fixed;
  left: 0;
  width: var(--w);
  height: calc(var(--w) * 0.45);
  pointer-events: auto;
  cursor: pointer;
  animation: drift linear infinite;
  will-change: transform;
}
.cloud.far { filter: blur(2px); }

/* NOTE: no var() inside these keyframes — iOS Safari does not resolve
   custom properties in @keyframes, which freezes the animation entirely.
   Percentages are relative to the element's own width, so -120% starts
   each cloud just offscreen left and 100vw ends it just offscreen right. */
@keyframes drift {
  from { transform: translateX(-120%); }
  to   { transform: translateX(100vw); }
}

.cloud-inner {
  position: absolute; inset: 0;
  animation: bob ease-in-out infinite alternate;
}
@keyframes bob {
  from { transform: translateY(-1.5%); }
  to   { transform: translateY(3%); }
}

/* the clouds are drawn as single svg shapes sharing one vertical gradient
   (lit above, shaded beneath) and a gaussian soften — painterly, cohesive */
.cloud svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.c-hi { stop-color: rgb(var(--cloud-rgb)); }
.c-lo { stop-color: rgb(var(--cloud-shade-rgb)); }

/* a cloud, once questioned, concedes the point and departs for good */
.cloud.dispelled { pointer-events: none; }
.cloud.dispelled .cloud-inner {
  animation: dispel 1.1s ease-out forwards !important;
}
@keyframes dispel {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(1.16) translateY(-6%); }
}

/* the passers-by: a bowler hat, an apple, an umbrella, and on occasion
   the word itself. none of them are there either. */
.drifter {
  position: fixed;
  left: 0;
  z-index: 8;
  pointer-events: auto;
  cursor: pointer;
  color: var(--ink);
  animation: drift linear 1;
}
.drifter svg { width: 100%; height: auto; display: block; }
.drifter > * { animation: bob 7s ease-in-out infinite alternate; }
.skyword {
  display: block;
  font-style: italic;
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  letter-spacing: 0.04em;
  opacity: 0.85;
  text-shadow: 0 1px 26px rgba(20, 30, 55, 0.12);
}

/* ---------- the words ---------- */

header {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 1.1rem);
  left: 0; right: 0;
  z-index: 30;
  text-align: center;
  pointer-events: none;
}
.wordmark {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.55em;
  text-transform: uppercase;
  text-indent: 0.55em; /* optically recenter the tracked-out caps */
  opacity: 0.85;
}

main {
  position: relative;
  z-index: 5;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 1.4rem;
  pointer-events: none;
}

h1 {
  font-size: clamp(2.7rem, 12.5vw, 7rem);
  font-weight: 500;
  font-style: italic;
  line-height: 1.02;
  letter-spacing: 0.005em;
  text-shadow: 0 2px 46px rgba(20, 30, 55, 0.10);
}

.subline {
  margin-top: 1.3rem;
  font-size: clamp(1.05rem, 4vw, 1.45rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  opacity: 0.92;
}

.deflin {
  margin-top: 2.6rem;
  max-width: 34ch;
  font-size: clamp(0.85rem, 3vw, 1rem);
  line-height: 1.45;
  opacity: 0.62;
}
.deflin strong { font-weight: 600; }

/* the live audit — real satellite-adjacent facts, reluctantly included */
.audit {
  margin-top: 1.6rem;
  max-width: 40ch;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1.7;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.audit.show { opacity: 0.55; }

/* the small denial that appears when a cloud is questioned */
#caption {
  position: fixed;
  z-index: 20;
  max-width: 16rem;
  font-style: italic;
  font-size: clamp(1rem, 3.4vw, 1.25rem);
  letter-spacing: 0.03em;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -0.2rem);
  transition: opacity 0.5s ease;
  text-shadow: 0 1px 22px rgba(20, 30, 55, 0.14);
}
#caption.show { opacity: 1; }

/* ---------- the small print ---------- */

footer {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.statusrow {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0 1rem 0.45rem;
  font-size: 0.6rem;
  opacity: 0.78;
}
#count { display: inline-block; min-width: 0.8em; }
#count.flash { animation: countflash 0.9s ease-out 1; }
@keyframes countflash {
  0%   { opacity: 0.2; }
  30%  { opacity: 1; }
  100% { opacity: 1; }
}
#recount {
  margin-left: 0.5em;
  text-transform: none;
  letter-spacing: 0.08em;
  font-style: italic;
  opacity: 0;
  transition: opacity 0.4s ease;
}
#recount.show { opacity: 0.85; }

.ticker {
  overflow: hidden;
  white-space: nowrap;
  padding: 0.5rem 0 calc(env(safe-area-inset-bottom, 0px) + 0.55rem);
  border-top: 1px solid rgba(128, 128, 128, 0.001); /* keeps its own paint layer */
  font-size: 0.6rem;
  opacity: 0.72;
  -webkit-mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
          mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
}
.ticker-inner {
  display: inline-block;
  animation: tick 150s linear infinite;
}
@keyframes tick {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.ticker-inner span { margin-right: 3.2em; }

/* ---------- courtesy ---------- */

/* reduced motion: the bobbing, twinkling and ticker calm right down,
   but the drift itself stays — it is the entire premise of the page,
   and at three minutes per crossing it is gentler than a scrollbar */
@media (prefers-reduced-motion: reduce) {
  .cloud-inner, .drifter > * { animation: none; }
  #stars .star { animation: none; opacity: 0.7; }
  .ticker-inner { animation-duration: 500s; }
}

@media (min-width: 900px) {
  .statusrow, .ticker { font-size: 0.66rem; }
}
