:root {
  --ink: #dfe6f5;
  --ink-dim: #93a3c4;
  --warm: #ffd9a0;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: #03050c;
  overflow: hidden;
}

body {
  font-family: ui-sans-serif, -apple-system, "Helvetica Neue", "PingFang SC", sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Cloud motion is translate- and opacity-only, and the moving group is an ancestor of the filtered
   bands rather than a wrapper around them, so each band rasterises once and afterwards only gets
   composited. There is no animated filter on this page: the near band used to cross-fade between
   two noise phases of itself, which meant a second 2000x250 turbulence pass for the sake of a
   morphing silhouette — and a silhouette on the horizon has nothing to morph. */
.cloudDrift, .cloudFar { will-change: transform; }

.cloudDrift { animation: cloudDrift 260s ease-in-out infinite alternate; }
.cloudFar { animation: cloudFarDrift 400s ease-in-out infinite alternate; }

@keyframes cloudDrift {
  from { transform: translate3d(-70px, 0, 0); }
  to   { transform: translate3d(80px, -14px, 0); }
}
/* The lesser clouds crawl more slowly than the main mass, which is the parallax that puts them
   behind it. */
@keyframes cloudFarDrift {
  from { transform: translate3d(-34px, 0, 0); }
  to   { transform: translate3d(38px, -8px, 0); }
}
.star { animation: twinkle var(--dur, 7s) ease-in-out infinite; animation-delay: var(--delay, 0s); }
@keyframes twinkle {
  0%, 100% { opacity: var(--base, 0.7); }
  50%      { opacity: var(--low, 0.2); }
}

.lit-flicker { animation: flicker var(--dur, 14s) steps(1, end) infinite; animation-delay: var(--delay, 0s); }
@keyframes flicker {
  0%, 92%   { opacity: var(--on, 0.85); }
  92.5%     { opacity: 0.08; }
  94%       { opacity: var(--on, 0.85); }
  96%       { opacity: 0.08; }
  100%      { opacity: var(--on, 0.85); }
}

.beacon { animation: beacon 5.5s ease-in-out infinite; animation-delay: var(--delay, 0s); }
@keyframes beacon {
  0%, 60%, 100% { opacity: 0.15; }
  75%           { opacity: 0.9; }
}

/* viewport-fit=cover lets the scene reach the gesture bar, which also means the text has to step
   back around whatever inset the device reports — 0 everywhere the browser UI already reserves
   the space. */
.wordmark {
  position: fixed;
  top: calc(clamp(18px, 4vh, 42px) + env(safe-area-inset-top));
  left: calc(clamp(20px, 5vw, 56px) + env(safe-area-inset-left));
  font-size: 13px;
  letter-spacing: 0.32em;
  text-transform: lowercase;
  color: var(--ink-dim);
}

.links {
  position: fixed;
  top: calc(clamp(18px, 4vh, 42px) + 34px + env(safe-area-inset-top));
  left: calc(clamp(20px, 5vw, 56px) + env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(12px, 2vh, 20px);
  text-align: left;
}

.links a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5em;
  color: var(--ink);
  text-decoration: none;
  font-size: clamp(17px, 2.2vw, 24px);
  font-weight: 300;
  letter-spacing: 0.06em;
  padding-bottom: 4px;
  opacity: 0.92;
  text-shadow: 0 0 22px rgba(3, 5, 12, 0.85), 0 0 6px rgba(3, 5, 12, 0.6);
  transition: opacity 0.5s ease, color 0.5s ease, letter-spacing 0.5s ease;
}

.links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 100%;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* All four marks get the same box: they are different drawings but the same piece of furniture,
   and the row should read as a list of links rather than as four logos competing. The box is a
   little wider than the type because two of the four are dense — the dumbbell glyph is five
   strokes in a 24-unit field and the detective is a face in a hat, and at 1em both collapse into
   a smudge. No filter and no shadow on them: this sits over the animated sky, and a filtered node
   repaints with it. */
.links .mark {
  width: 1.3em;
  height: 1.3em;
  flex: none;
}

.links a:hover, .links a:focus-visible {
  color: var(--warm);
  opacity: 1;
  letter-spacing: 0.09em;
  outline: none;
}

.links a:hover::after, .links a:focus-visible::after { transform: scaleX(1); }

@media (max-width: 520px) {
  .links { gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .cloudDrift, .cloudFar, .star, .lit-flicker, .beacon { animation: none; }
}
