/* Reset, type, the room's lighting, and the small shared pieces (glass, chips, buttons, avatar). */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--t-md)/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, dl, dd, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* ---------- lighting ---------- */

.atmos {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--bg);
  pointer-events: none;
}
.atmos__cold {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 55% at 12% -8%, rgba(132, 160, 220, 0.2), transparent 62%),
    radial-gradient(55% 45% at 104% 108%, rgba(96, 116, 170, 0.13), transparent 60%),
    radial-gradient(40% 30% at 62% 46%, rgba(255, 255, 255, 0.025), transparent 70%);
}
.atmos__alert {
  position: absolute;
  inset: 0;
  background: radial-gradient(38% 42% at var(--ax, 50%) var(--ay, 40%), rgba(255, 61, 79, 0.3), transparent 70%);
  opacity: 0;
  transition: opacity 2.2s ease-out;
}
.is-alert .atmos__alert { opacity: 1; transition-duration: 0.3s; }
.atmos__grain {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- glass ---------- */

.glass {
  background: linear-gradient(180deg, var(--glass-top), var(--glass-bottom));
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.11),
    inset 0 0 0 1px rgba(255, 255, 255, 0.015),
    0 30px 70px -30px rgba(0, 0, 0, 0.75);
}

/* ---------- type pieces ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font: 500 var(--t-xs)/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.eyebrow i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--x);
  box-shadow: 0 0 0 4px var(--x-soft);
}

h1 {
  font-size: var(--t-display);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
h1 em {
  font-style: normal;
  font-weight: 300;
  color: var(--ink-2);
}

/* ---------- chips, pills, buttons ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  font: 500 0.6875rem/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--c-ink, var(--ink-2));
  background: var(--c-soft, var(--steel-soft));
  border: 1px solid color-mix(in srgb, var(--c, var(--steel)) 32%, transparent);
}
.chip i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c, var(--steel));
}
[data-state='xd'] { --c: var(--x); --c-ink: var(--x-ink); --c-soft: var(--x-soft); }
[data-state='sniped'], [data-state='dev'] { --c: var(--amber); --c-ink: var(--amber-ink); --c-soft: var(--amber-soft); }
[data-state='clean'] { --c: var(--up); --c-ink: #8fe6c0; --c-soft: rgba(95, 214, 164, 0.13); }
[data-state='watching'], [data-state='scanning'], [data-state='unchecked'] { --c: var(--steel); --c-ink: var(--ink-2); --c-soft: var(--steel-soft); }
.chip[data-state='scanning'] i { animation: blink 1s ease-in-out infinite; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--fill);
  font: 500 0.6875rem/1 var(--mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}
.pill--demo { border-style: dashed; border-color: var(--line-strong); }
.pill--live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--up);
  animation: blink 1.8s ease-in-out infinite;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 48px;
  padding: 0 var(--s-5);
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--fill);
  font-weight: 500;
  cursor: pointer;
  transition: transform var(--fast) var(--ease-out), background var(--fast), border-color var(--fast);
}
.btn:hover { background: var(--fill-strong); border-color: rgba(255, 255, 255, 0.3); }
.btn:active { transform: scale(0.97); }
.btn--primary {
  flex: 1;
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.btn--primary:hover { background: #fff; border-color: #fff; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--fill);
  cursor: pointer;
  transition: background var(--fast), transform var(--fast) var(--ease-out);
}
.icon-btn:hover { background: var(--fill-strong); }
.icon-btn:active { transform: scale(0.94); }

/* segmented control */
.seg {
  display: inline-flex;
  padding: 4px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
}
.seg button {
  min-height: 40px;
  padding: 0 var(--s-4);
  border: 0;
  border-radius: var(--r-pill);
  background: none;
  color: var(--ink-2);
  font-size: var(--t-sm);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--base) var(--ease-out), color var(--fast);
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed='true'] {
  background: var(--fill-strong);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

/* ---------- coin avatar ---------- */

.av {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background:
    radial-gradient(120% 120% at 28% 18%, hsl(var(--hue) 46% 58%), hsl(calc(var(--hue) + 36) 42% 20%) 72%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.5),
    inset 0 calc(var(--s) * -0.14) calc(var(--s) * 0.22) rgba(0, 0, 0, 0.42),
    0 0 0 1.5px var(--ring, rgba(255, 255, 255, 0.16)),
    0 calc(var(--s) * 0.12) calc(var(--s) * 0.3) rgba(0, 0, 0, 0.45);
}
.av[data-state='xd'] { --ring: var(--x); }
.av[data-state='sniped'] { --ring: var(--amber); }
.av[data-state='clean'] { --ring: var(--up); }
.av__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  /* the glass highlight and shading sit on top of the picture */
  -webkit-mask: radial-gradient(closest-side, #000 99%, transparent);
  mask: radial-gradient(closest-side, #000 99%, transparent);
}
.av::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(90% 70% at 30% 12%, rgba(255, 255, 255, 0.28), transparent 55%);
  box-shadow: inset 0 calc(var(--s) * -0.12) calc(var(--s) * 0.2) rgba(0, 0, 0, 0.4);
  pointer-events: none;
}
.av__ok {
  position: absolute;
  right: -4%;
  bottom: -4%;
  z-index: 1;
  display: none;
  place-items: center;
  width: 38%;
  height: 38%;
  min-width: 14px;
  min-height: 14px;
  border-radius: 50%;
  background: var(--up);
  color: #04130c;
  box-shadow: 0 0 0 2px var(--bg);
}
.av__ok svg { width: 70%; height: 70%; stroke-width: 3; }
.av[data-state='clean'] .av__ok { display: grid; }
.av__x {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  border-radius: 50%;
  background: rgba(8, 6, 8, 0.5);
  color: var(--x);
}
.av__x svg {
  width: 78%;
  height: 78%;
  stroke-width: 2.6;
  filter: drop-shadow(0 0 5px rgba(255, 61, 79, 0.75));
}
.av[data-state='xd'] .av__x { display: grid; z-index: 1; }

/* ---------- motion ---------- */

@keyframes blink { 50% { opacity: 0.35; } }

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--slow) var(--ease-out), transform var(--slow) var(--ease-out);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}
