/*
  The palette is the badge of the mark (mark.svg): a navy ground, a magenta to
  cyan gradient, and a pale spark where the four petals meet.

  Animations only run under `.js`, which main.js sets before the first paint:
  without JavaScript, every line is in place and nothing waits to be revealed.
*/
:root {
  --ink-0: #03071a;
  --ink-1: #0a1738;
  --violet: #e15bff;
  --blue: #6b9cff;
  --cyan: #3ee0ff;
  --spark: #8ceaff;
  --text: #d6defa;
  --muted: #7c89b5;
  --gradient: linear-gradient(90deg, var(--violet), var(--blue) 45%, var(--cyan));
  --mono:
    ui-monospace, 'SFMono-Regular', 'Cascadia Mono', 'Segoe UI Mono', Menlo, Consolas,
    'Liberation Mono', monospace;
  --sans:
    ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --line-height: 20px;

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 50% 42%, var(--ink-1) 0%, #060e2c 45%, var(--ink-0) 100%)
      fixed,
    var(--ink-0);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── The log stream, behind everything ─────────────────────────────────── */

.stream {
  position: fixed;
  inset: 0;
  display: flex;
  gap: 2.5rem;
  padding: 0 1.5rem;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  font-family: var(--mono);
  font-size: 12px;
  line-height: var(--line-height);
  color: rgb(140 170 255 / 0.2);
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
}

.stream .col {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
  height: 100%;
}

.stream .line {
  overflow: hidden;
  white-space: pre;
  text-overflow: clip;
}

.stream .line.alert {
  color: rgb(225 91 255 / 0.55);
}

.stream .line.verdict {
  color: rgb(107 156 255 / 0.5);
}

.stream .line.flag {
  color: rgb(62 224 255 / 0.65);
}

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 46% 42% at 50% 48%,
    rgb(3 7 26 / 0.94) 0%,
    rgb(3 7 26 / 0.7) 55%,
    rgb(3 7 26 / 0) 100%
  );
}

/* ── The stage ──────────────────────────────────────────────────────────── */

.stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  min-height: 100vh;
  min-height: 100svh;
  padding: 4rem 1.5rem 6rem;
  text-align: center;
}

.emblem {
  position: relative;
  width: clamp(76px, 11vw, 104px);
  aspect-ratio: 1;
  margin-bottom: 0.6rem;
}

.mark {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 22%;
  box-shadow:
    0 0 0 1px rgb(107 156 255 / 0.15),
    0 18px 50px -12px rgb(62 224 255 / 0.35);
}

/* A slow, blurred turn of the gradient: the mark seems lit from behind. */
.glow {
  position: absolute;
  inset: -12%;
  border-radius: 30%;
  background: conic-gradient(from 0deg, var(--violet), var(--blue), var(--cyan), var(--violet));
  filter: blur(22px);
  opacity: 0.4;
}

/* The spark, where the petals converge: 36.7 / 64 of the mark, 53 % of this wider box. */
.halo {
  position: absolute;
  inset: -70%;
  background: radial-gradient(
    circle at 50% 53%,
    rgb(140 234 255 / 0.32) 0%,
    rgb(107 156 255 / 0.1) 22%,
    transparent 48%
  );
}

.signal {
  margin: 0;
  min-height: 1.4em;
  font-family: var(--mono);
  font-size: clamp(0.78rem, 1.6vw, 0.9rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgb(62 224 255 / 0.85);
}

.headline {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(2.1rem, 7vw, 4.8rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  filter: drop-shadow(0 0 22px rgb(107 156 255 / 0.25));
}

/*
  The gradient lives on each line, never on the heading: `background-clip: text`
  paints through the text of every descendant, clip or not, so on the heading it
  would also paint the screen-reader copy that main.js slips beside each line.
*/
.headline > [data-decrypt] {
  display: block;
  white-space: pre;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* A character still being decrypted. */
.headline .noise {
  color: rgb(140 234 255 / 0.55);
}

.pitch {
  max-width: 42ch;
  margin: 0.4rem 0 0;
  font-size: clamp(1rem, 2.2vw, 1.28rem);
  line-height: 1.65;
  color: rgb(214 222 250 / 0.88);
  text-wrap: balance;
}

.pitch-line {
  display: block;
}

.pitch em {
  font-style: normal;
  font-weight: 600;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.8rem 0 0;
  padding: 0.5rem 1rem;
  border: 1px solid rgb(107 156 255 / 0.3);
  border-radius: 999px;
  background: rgb(10 23 56 / 0.65);
  backdrop-filter: blur(6px);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}

.footer {
  position: fixed;
  right: 0;
  bottom: 1.2rem;
  left: 0;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.clock::after {
  content: ' ·';
}

/* ── Motion, under `.js` only ───────────────────────────────────────────── */

.js .emblem {
  animation: emerge 1.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.js .mark {
  animation: float 7s ease-in-out infinite;
}

.js .glow {
  animation: spin 14s linear infinite;
}

.js .halo {
  animation: pulse 4.5s ease-in-out infinite;
}

.js .dot {
  animation: blink 2.2s ease-in-out infinite;
}

/* Hidden until main.js takes them over: never a flash of the final text. */
.js [data-type]:not(.is-live),
.js [data-decrypt]:not(.is-live) {
  visibility: hidden;
}

.js .signal.is-live::after {
  content: '▍';
  margin-left: 0.15em;
  animation: blink 1.1s steps(1) infinite;
}

.js [data-reveal] {
  opacity: 0;
  filter: blur(6px);
  transform: translateY(10px);
  transition:
    opacity 1s ease,
    filter 1s ease,
    transform 1s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.js [data-reveal].is-revealed {
  opacity: 1;
  filter: none;
  transform: none;
}

.js .stream .line.is-new {
  animation: appear 0.6s ease-out both;
}

@keyframes emerge {
  from {
    opacity: 0;
    transform: scale(0.82);
    filter: blur(10px);
  }
}

@keyframes float {
  50% {
    transform: translateY(-6px);
  }
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

@keyframes pulse {
  50% {
    opacity: 0.45;
    transform: scale(0.92);
  }
}

@keyframes blink {
  50% {
    opacity: 0.25;
  }
}

@keyframes appear {
  from {
    opacity: 0;
    color: rgb(140 234 255 / 0.7);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 640px) {
  .stream {
    font-size: 11px;
    padding: 0 0.75rem;
  }

  .vignette {
    background: radial-gradient(
      ellipse 80% 48% at 50% 48%,
      rgb(3 7 26 / 0.94) 0%,
      rgb(3 7 26 / 0.72) 60%,
      rgb(3 7 26 / 0.2) 100%
    );
  }

  .headline > [data-decrypt] {
    white-space: normal;
  }
}
