:root {
  --bg: #05060f;
  --cyan: #00e5ff;
  --magenta: #ff2bd6;
  --text: #d8e6ff;
  --dim: #7f8fb5;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  overflow: hidden;
  display: grid;
  place-items: center;
  position: relative;
}

/* layered backdrop: city, then circuitry, then a vignette for legibility */
.bg {
  position: fixed; inset: 0;
  background: url("images/hero.jpg") center / cover no-repeat;
  filter: saturate(1.05);
  transform: scale(1.04);
  animation: drift 40s ease-in-out infinite alternate;
}
.bg::after {
  content: ""; position: absolute; inset: 0;
  background: url("images/circuit.jpg") center / cover no-repeat;
  mix-blend-mode: screen; opacity: .35;
}
.veil {
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(5,6,15,.25) 0%, rgba(5,6,15,.78) 70%, rgba(5,6,15,.95) 100%),
    linear-gradient(to bottom, rgba(5,6,15,.55), rgba(5,6,15,.15) 40%, rgba(5,6,15,.7));
}
.scan {
  position: fixed; inset: 0; pointer-events: none; opacity: .12;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.55) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

main {
  position: relative;   /* no z-index: keeps the emblem's blend mode in the root stacking context */
  text-align: center;
  padding: 2rem 1.25rem;
  display: flex; flex-direction: column; align-items: center;
  gap: clamp(.75rem, 2.2vh, 1.5rem);
}
.mark {
  width: clamp(190px, 26vw, 320px);
  margin-bottom: -2.5rem;               /* the artwork has padding; pull the title closer */
  aspect-ratio: 1;
  background: url("images/emblem.jpg") center / contain no-repeat;
  mix-blend-mode: screen;               /* drops the black, keeps the glow */
  animation: pulse 5s ease-in-out infinite;
}
.eyebrow {
  font-size: clamp(.7rem, 1.4vw, .85rem);
  letter-spacing: .38em; text-transform: uppercase;
  color: var(--cyan); opacity: .85;
}
h1 {
  font-size: clamp(2.2rem, 8vw, 5.2rem);
  font-weight: 700; letter-spacing: .06em; line-height: 1.05;
  color: #fff;
  text-shadow: 0 0 14px rgba(0,229,255,.55), 0 0 42px rgba(255,43,214,.35);
  position: relative;
  animation: flicker 7s infinite;
}
h1::before, h1::after {
  content: attr(data-text); position: absolute; inset: 0; pointer-events: none;
  opacity: .0;
}
h1::before { color: var(--cyan);    transform: translate(-2px, 0); animation: glitch 9s infinite steps(1); }
h1::after  { color: var(--magenta); transform: translate( 2px, 0); animation: glitch 9s infinite steps(1) .08s; }
.tag {
  font-size: clamp(.85rem, 2vw, 1.15rem);
  letter-spacing: .12em; color: var(--text);
}
.tag span { color: var(--magenta); padding: 0 .45em; }
.rule {
  width: min(320px, 60vw); height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: .7;
}
.status {
  font-size: clamp(.7rem, 1.5vw, .85rem);
  letter-spacing: .22em; text-transform: uppercase; color: var(--dim);
}
.status::after {
  content: "_"; color: var(--cyan);
  animation: blink 1.1s steps(1) infinite;
}

/* sound toggle */
.sound {
  position: fixed; left: 50%; bottom: max(1.25rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: .7rem;
  padding: .55rem 1rem;
  font: inherit; font-size: .72rem; letter-spacing: .24em; text-transform: uppercase;
  color: var(--dim); background: rgba(5,6,15,.55);
  border: 1px solid rgba(0,229,255,.28); border-radius: 999px;
  cursor: pointer; backdrop-filter: blur(6px);
  transition: color .3s, border-color .3s, box-shadow .3s;
}
.sound:hover, .sound:focus-visible { color: var(--cyan); border-color: var(--cyan); outline: none; box-shadow: 0 0 14px rgba(0,229,255,.3); }
.sound[aria-pressed="true"] { color: var(--cyan); }
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.bars i { width: 2px; height: 3px; background: currentColor; border-radius: 1px; }
.sound[aria-pressed="true"] .bars i { animation: eq 1.1s ease-in-out infinite; }
.bars i:nth-child(2) { animation-delay: .25s !important; }
.bars i:nth-child(3) { animation-delay: .5s !important; }
.bars i:nth-child(4) { animation-delay: .15s !important; }
@keyframes eq { 0%,100% { height: 3px; } 50% { height: 12px; } }

@keyframes drift  { from { transform: scale(1.04) translate3d(-.6%, 0, 0); } to { transform: scale(1.09) translate3d(.6%, -.6%, 0); } }
@keyframes pulse  { 0%,100% { opacity: .85; } 50% { opacity: 1; } }
@keyframes blink  { 50% { opacity: 0; } }
@keyframes flicker{ 0%,92%,100% { opacity: 1; } 93% { opacity: .78; } 94% { opacity: 1; } 96% { opacity: .85; } }
@keyframes glitch {
  0%,93%,100% { opacity: 0; clip-path: inset(0 0 0 0); }
  94% { opacity: .8; clip-path: inset(12% 0 62% 0); }
  96% { opacity: .8; clip-path: inset(58% 0 14% 0); }
  98% { opacity: .8; clip-path: inset(30% 0 40% 0); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}
