:root {
  /* Colors */
  --color-midnight-carbon: #12130f;
  --color-bone-glow: #e4dfda;
  --color-charcoal-vein: #3c3c38;
  --color-rose-quartz-bloom: #f5c2c8;

  /* Typography — Font Families */
  --font-technik: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-contrast: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Typography — Scale */
  --text-caption: 12px;
  --tracking-caption: -0.6px;
  --text-body: 16px;

  /* Spacing */
  --spacing-4: 4px;
  --spacing-8: 8px;
  --spacing-12: 12px;
  --spacing-64: 64px;

  /* Border Radius */
  --radius-full: 9999px;
}

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

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

body {
  overflow: hidden;
  background: var(--color-midnight-carbon);
  color: var(--color-bone-glow);
  font-family: var(--font-contrast);
  font-size: var(--text-body);
  font-weight: 400;
  line-height: 1.25;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: var(--color-bone-glow);
  color: var(--color-midnight-carbon);
}

/* ——— Particle field ——— */

.field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
  touch-action: manipulation;
}

/* ——— Stage: wordmark + GitHub link ——— */

.stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: grid;
  place-content: center;
  justify-items: start;
  padding: var(--spacing-12);
  pointer-events: none;
}

.wordmark {
  margin: 0;
  font-family: var(--font-contrast);
  font-weight: 800;
  font-size: clamp(72px, 15vw, 240px);
  line-height: 0.82;
  letter-spacing: -0.04em;
  white-space: nowrap;
  color: var(--color-bone-glow);
  animation: reveal 600ms ease 1.4s both;
}

.wordmark span {
  display: inline-block;
}

/* When the particle field is live, the heading keeps its box (it is the
   layout anchor for the particles and the link) but is drawn by particles. */
.is-live .wordmark {
  color: transparent;
  animation: none;
}

.pill {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-8);
  margin-top: clamp(16px, 3vw, 36px);
  margin-left: calc(var(--spacing-12) * -1);
  padding: 10px 18px 10px var(--spacing-12);
  border-radius: var(--radius-full);
  /* Same tone as the canvas: invisible on its own, but keeps the link
     legible when particles pass behind it. */
  background: var(--color-midnight-carbon);
  color: var(--color-bone-glow);
  font-family: var(--font-contrast);
  font-size: var(--text-body);
  line-height: 1.25;
  text-decoration: none;
  transition: background-color 160ms ease;
}

.pill svg {
  flex: none;
}

.pill:hover {
  background: var(--color-charcoal-vein);
}

.pill:focus-visible {
  outline: 1px solid var(--color-bone-glow);
  outline-offset: 2px;
}

/* ——— HUD telemetry ——— */

.hud {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  font-family: var(--font-technik);
  font-size: var(--text-caption);
  line-height: 1.25;
  letter-spacing: var(--tracking-caption);
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.hud-cluster {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-4);
}

.hud-tl,
.hud-tr {
  top: max(var(--spacing-12), env(safe-area-inset-top));
}

.hud-bl,
.hud-br {
  bottom: max(var(--spacing-12), env(safe-area-inset-bottom));
}

.hud-tl,
.hud-bl {
  left: max(var(--spacing-12), env(safe-area-inset-left));
}

.hud-tr,
.hud-br {
  right: max(var(--spacing-12), env(safe-area-inset-right));
  align-items: flex-end;
  text-align: right;
}

.hud-dim {
  opacity: 0.55;
}

.on-touch {
  display: none;
}

@media (hover: none) {
  .on-hover {
    display: none;
  }

  .on-touch {
    display: inline;
  }
}

/* ——— Small screens: stack the wordmark ——— */

@media (max-width: 640px) {
  .wordmark {
    font-size: 30vw;
  }

  .wordmark span {
    display: block;
  }
}

@keyframes reveal {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}
