/* The reticle's drawn frame (toggle.css) stays on the choosers only. It was tried on the header and on
   the buttons and links of the control room, and was too much there: those keep their plain styles.
   What carries over is the light itself. */

/* The chapter marks down the side: the current one is a lit filament. */
.dots button[aria-current='true']::before {
  background: #ffeafd;
  box-shadow: 0 0 3px #ff4dea, 0 0 8px #ff2fe6, 0 0 16px rgba(255, 47, 230, 0.7);
}

/* The two marks at the foot of the cover, as projected light: a solid cyan image cut by scan lines,
   torn sideways along some of them, with a soft bloom. Nowhere but the cover. */
.home-marks {
  position: fixed;
  z-index: 11;
  left: 50%;
  bottom: clamp(34px, 9vh, 96px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 30px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

body[data-ch='0'].ready:not(.flying):not(.menu-open) .home-marks {
  opacity: 1;
}

.holo {
  position: relative;
  display: block;
  filter: drop-shadow(0 0 5px rgba(90, 215, 255, 0.55)) drop-shadow(0 0 16px rgba(40, 170, 255, 0.4));
  animation: holo-flicker 5.2s steps(1) infinite;
}

/* The logo itself, as a cut-out of light. */
.holo-shape {
  position: absolute;
  inset: 0;
  -webkit-mask: var(--mark) center / contain no-repeat;
  mask: var(--mark) center / contain no-repeat;
  background: linear-gradient(to bottom, #c9f6ff 0%, #7fe6ff 40%, #38bfff 100%);
}

/* The image proper: dark scan lines every third pixel, and a faint darker band rolling down it. */
.holo-core {
  background:
    repeating-linear-gradient(to bottom, rgba(2, 30, 52, 0.45) 0 1px, transparent 1px 3px),
    linear-gradient(to bottom, #c9f6ff 0%, #7fe6ff 40%, #38bfff 100%);
  opacity: 0.66; /* light, not paint: the city shows through it */
}

/* The tear: the same image smeared sideways, showing only on scattered scan lines, so it reads as thin
   streaks running out past the edges of the letters. */
.holo-smear {
  position: absolute;
  inset: 0 -46px;
  -webkit-mask:
    repeating-linear-gradient(to bottom, #000 0 1px, transparent 1px 3px),
    repeating-linear-gradient(to bottom, #000 0 2px, transparent 2px 7px, #000 7px 8px, transparent 8px 13px);
  -webkit-mask-composite: source-in;
  mask:
    repeating-linear-gradient(to bottom, #000 0 1px, transparent 1px 3px),
    repeating-linear-gradient(to bottom, #000 0 2px, transparent 2px 7px, #000 7px 8px, transparent 8px 13px);
  mask-composite: intersect;
  opacity: 1;
  filter: brightness(1.9);
  animation: holo-tear 3.7s steps(1) infinite;
}

.holo-smear > i {
  position: absolute;
  inset: 0;
  filter: url(#holo-smear);
}

.holo-smear > i > .holo-shape {
  inset: 0 46px;
}

/* Sized so the lettering of the two reads the same height: Skio's letters are tall in their box,
   Recharge's are small in theirs. */
.holo-skio {
  --mark: url('assets/skio.svg');
  width: 86px;
  height: 33px;
}

.holo-recharge {
  --mark: url('assets/recharge.svg');
  width: 148px;
  height: 34px;
  margin-top: 5px; /* its descender hangs below the line the Skio letters sit on */
  animation-delay: -2.1s;
}

.holo-recharge .holo-smear {
  animation-delay: -1.3s;
}

.holo-x {
  font-family: var(--mono);
  font-size: 13px;
  color: rgba(150, 230, 255, 0.6);
}

@keyframes holo-flicker {
  0%, 100% { opacity: 1; transform: none; }
  41% { opacity: 0.62; }
  42% { opacity: 1; }
  77% { opacity: 0.78; transform: translateX(1px); }
  78% { opacity: 1; transform: none; }
}

@keyframes holo-tear {
  0%, 100% { transform: none; }
  18% { transform: translateX(5px); }
  20% { transform: translateX(-3px); }
  22% { transform: none; }
  63% { transform: translateX(-6px); }
  65% { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .holo,
  .holo-smear {
    animation: none;
  }
}

/* On a phone the marks sit a size smaller and lower, under the figures. */
@media (max-aspect-ratio: 1/1) {
  .home-marks {
    bottom: clamp(16px, 2.6vh, 28px);
    gap: 20px;
  }

  .holo-skio {
    width: 62px;
    height: 24px;
  }

  .holo-recharge {
    width: 109px;
    height: 25px;
    margin-top: 4px;
  }

  .holo-smear {
    inset: 0 -24px;
  }

  .holo-smear > i > .holo-shape {
    inset: 0 24px;
  }
}

/* The cover title is the same projection as the marks under it, turned up: electric pink, wider scan
   lines, and long tears pulled sideways out of the letters. Like them it is light, not paint: partly
   see-through, so the city shows behind the letters. The words are drawn once as the image
   (the heading itself) and once more, smeared, for the tears (its ::before, fed by data-text). */
h1 {
  position: relative;
  color: transparent;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 0;
  background:
    repeating-linear-gradient(to bottom, rgba(40, 0, 44, 0.5) 0 2px, transparent 2px 5px),
    linear-gradient(to bottom, rgba(255, 240, 254, 0.8) 0%, rgba(255, 157, 244, 0.72) 38%, rgba(255, 47, 230, 0.66) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 2px #ff6bee) drop-shadow(0 0 12px rgba(255, 47, 230, 0.7)) drop-shadow(0 0 34px rgba(255, 47, 230, 0.4));
  animation: holo-flicker 6.4s steps(1) infinite;
}

h1::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  white-space: pre;
  color: #ff7df0;
  -webkit-text-fill-color: #ff7df0;
  pointer-events: none;
  /* blurred sideways first, then cut down to scattered scan lines: what is left are the tears */
  filter: url(#title-smear) brightness(2.3);
  -webkit-mask:
    repeating-linear-gradient(to bottom, #000 0 2px, transparent 2px 5px),
    repeating-linear-gradient(to bottom, #000 0 3px, transparent 3px 11px, #000 11px 13px, transparent 13px 24px, #000 24px 29px, transparent 29px 37px);
  -webkit-mask-composite: source-in;
  mask:
    repeating-linear-gradient(to bottom, #000 0 2px, transparent 2px 5px),
    repeating-linear-gradient(to bottom, #000 0 3px, transparent 3px 11px, #000 11px 13px, transparent 13px 24px, #000 24px 29px, transparent 29px 37px);
  mask-composite: intersect;
  animation: title-tear 4.3s steps(1) infinite;
}

@keyframes title-tear {
  0%, 100% { transform: none; }
  14% { transform: translateX(14px); }
  16% { transform: translateX(-9px); }
  18% { transform: none; }
  57% { transform: translateX(-18px); }
  59% { transform: translateX(6px); }
  61% { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  h1,
  h1::before {
    animation: none;
  }
}

/* The title is small on a phone: finer scan lines and shorter tears, or the letters stop reading. */
@media (max-aspect-ratio: 1/1) {
  h1 {
    background:
      repeating-linear-gradient(to bottom, rgba(40, 0, 44, 0.6) 0 1px, transparent 1px 3px),
      linear-gradient(to bottom, rgba(255, 240, 254, 0.8) 0%, rgba(255, 157, 244, 0.72) 38%, rgba(255, 47, 230, 0.66) 100%);
    -webkit-background-clip: text;
    background-clip: text;
  }

  h1::before {
    filter: url(#holo-smear) brightness(2);
  }
}
