/* Original Token API homepage shell; the downhill game keeps its own styling. */
:root {
  --ink: #111827;
  --muted: #64748b;
  --line: #d8dee8;
  --paper: #f8fafc;
  --paper-2: #eef6fb;
  --accent: #0ea5e9;
  --accent-2: #7c3aed;
  --good: #16a34a;
  --warn: #ca8a04;
  --bad: #dc2626;
  --time-bg: 248, 250, 252;
  --time-haze-a: 14, 165, 233;
  --time-haze-b: 124, 58, 237;
}

body {
  background:
    linear-gradient(90deg, rgba(17, 24, 39, 0.045) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(0deg, rgba(17, 24, 39, 0.045) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(135deg, rgba(var(--time-haze-a), 0.022), transparent 34%),
    linear-gradient(315deg, rgba(var(--time-haze-b), 0.018), transparent 40%),
    var(--paper);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  transform: none;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, transparent 0 8px, rgba(17, 24, 39, 0.018) 8px 9px),
    radial-gradient(circle at 50% 56%, transparent 56%, rgba(255, 255, 255, 0.25) 100%);
  mix-blend-mode: multiply;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 12%, rgba(var(--time-haze-a), 0.012), transparent 24%),
    radial-gradient(circle at 88% 80%, rgba(var(--time-haze-b), 0.012), transparent 28%);
}

.ambient-fx,
.elastic-mesh,
.cursor-trail {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  background: transparent;
}

.ambient-fx { z-index: 0; image-rendering: pixelated; }
.elastic-mesh { z-index: 0; }
.cursor-trail { z-index: 3; image-rendering: pixelated; }

body.custom-cursor-ready,
body.custom-cursor-ready a,
body.custom-cursor-ready button,
body.custom-cursor-ready canvas { cursor: none; }

.pixel-cursor {
  position: fixed;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  z-index: 5;
  pointer-events: none;
  transform: translate(-50%, -50%);
  background:
    linear-gradient(var(--ink), var(--ink)) 50% 0 / 2px 7px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 50% 100% / 2px 7px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 50% / 7px 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 100% 50% / 7px 2px no-repeat,
    linear-gradient(#fff, #fff) 50% 50% / 8px 8px no-repeat;
  filter: drop-shadow(0 1px 0 rgba(17, 24, 39, 0.22));
  image-rendering: pixelated;
  opacity: 0;
  transition: opacity 0.12s ease, width 0.1s ease, height 0.1s ease, transform 0.1s ease;
}

.pixel-cursor::before,
.pixel-cursor::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--accent);
}
.pixel-cursor::before { width: 4px; height: 4px; }
.pixel-cursor::after { width: 2px; height: 2px; background: var(--ink); }
.pixel-cursor.is-active { opacity: 1; }
.pixel-cursor.is-clickable { width: 26px; height: 26px; }
.pixel-cursor.is-clicking { width: 14px; height: 14px; transform: translate(-50%, -50%) rotate(45deg); }
.pixel-cursor.is-clicking::before { background: var(--warn); }

.masthead,
.homepage { position: relative; z-index: 1; }
.masthead { gap: 18px; }
.masthead .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #111827;
  letter-spacing: 0;
}
.masthead .mark {
  width: 42px;
  height: 42px;
  border: 2px solid #111827;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 900;
  background: #fff;
  box-shadow: 4px 4px 0 #111827;
  flex: 0 0 auto;
}
.brand-copy { min-width: 0; }
.masthead .brand strong {
  display: block;
  font-size: clamp(24px, 4vw, 42px);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: 0;
}
.masthead .brand small {
  display: block;
  margin: 6px 0 0;
  color: #64748b;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
}
.masthead nav { gap: 10px; flex-wrap: nowrap; justify-content: flex-end; }
.masthead nav a,
.masthead nav .nav-action {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 2px solid #111827;
  border-radius: 0;
  background: #fff;
  color: #111827;
  text-decoration: none;
  box-shadow: 3px 3px 0 #111827;
  font: 800 13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
}
.masthead nav a:hover { opacity: 1; transform: translate(1px, 1px); box-shadow: 2px 2px 0 #111827; }

@media (max-width: 600px) {
  .masthead { flex-wrap: wrap; gap: 16px; }
  .masthead .brand { gap: 10px; }
  .masthead .brand strong { font-size: 24px; }
  .masthead .brand small { font-size: 11px; }
  .masthead .mark { width: 36px; height: 36px; font-size: 12px; }
  .masthead nav { display: flex; width: 100%; gap: 8px; justify-content: flex-start; }
  .masthead nav a,
  .masthead nav .nav-action { display: inline-flex; font-size: 10px; padding: 0 11px; min-height: 34px; }
}
