/* ===============================================================
   Orbit Cards — Wallet OS
   1 tokens · 2 shell + backdrop · 3 boot · 4 chrome · 5 stage
   6 cards · 7 hud · 8 detail view · 9 modal/toast · 10 responsive
   =============================================================== */

/* ------------------------------ 1 tokens ------------------------------ */

:root {
  --bg: #04050a;
  --bg-2: #0a0d1a;
  --ink: #eef1ff;
  --muted: #878db0;
  --dim: #5b6187;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.16);
  --glass: rgba(255, 255, 255, 0.045);
  --glass-2: rgba(255, 255, 255, 0.09);

  --accent: #8b7bff;
  --accent-2: #ff6aa8;
  --accent-3: #38e8d2;
  --accent-rgb: 139, 123, 255;

  --cw: clamp(168px, 17.5vw, 252px);
  --ch: calc(var(--cw) / 1.586);
  --radius: calc(var(--cw) * 0.064);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --mono: "SF Mono", ui-monospace, "Roboto Mono", Menlo, monospace;
  --pad: clamp(16px, 3vw, 34px);
}

[data-accent="cyan"]  { --accent: #3ce0ff; --accent-2: #6a7bff; --accent-3: #35ffc7; --accent-rgb: 60, 224, 255; }
[data-accent="amber"] { --accent: #ffb454; --accent-2: #ff5f7e; --accent-3: #ffe27a; --accent-rgb: 255, 180, 84; }
[data-accent="lime"]  { --accent: #9cff57; --accent-2: #3ce0ff; --accent-3: #d6ff8a; --accent-rgb: 156, 255, 87; }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
}

button { font: inherit; color: inherit; border: 0; background: none; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ------------------------------ 2 shell + backdrop ------------------------------ */

.app {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  height: 100%;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  isolation: isolate;
}

.fx { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; }

.backdrop {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg-2), var(--bg) 60%);
}

/* slow drifting colour fields */
.aurora { position: absolute; inset: -20%; filter: blur(40px); opacity: 0.85; }

.aurora::before,
.aurora::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.aurora::before {
  top: -12%;
  left: 12%;
  width: 62%;
  height: 62%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.5), transparent 62%);
  animation: drift1 22s ease-in-out infinite alternate;
}

.aurora::after {
  bottom: -18%;
  right: 6%;
  width: 58%;
  height: 58%;
  background: radial-gradient(circle, rgba(255, 106, 168, 0.32), transparent 62%);
  animation: drift2 27s ease-in-out infinite alternate;
}

@keyframes drift1 { to { transform: translate3d(9%, 6%, 0) scale(1.14); } }
@keyframes drift2 { to { transform: translate3d(-11%, -7%, 0) scale(1.1); } }

.floor {
  position: absolute;
  left: -50%;
  right: -50%;
  bottom: -16vh;
  height: 64vh;
  background-image:
    linear-gradient(to right, rgba(var(--accent-rgb), 0.34) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(var(--accent-rgb), 0.34) 1px, transparent 1px);
  background-size: 74px 74px;
  transform: perspective(520px) rotateX(74deg);
  transform-origin: 50% 100%;
  animation: floorRun 8s linear infinite;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 40%, transparent 92%);
  mask-image: linear-gradient(to bottom, transparent, #000 40%, transparent 92%);
  opacity: 0.42;
}

@keyframes floorRun { to { background-position: 0 74px, 0 74px; } }

.grain {
  position: absolute;
  inset: -100%;
  opacity: 0.045;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/></filter><rect width='180' height='180' filter='url(%23n)'/></svg>");
  animation: grainShift 0.9s steps(3) infinite;
  pointer-events: none;
}

@keyframes grainShift {
  0%   { transform: translate(0, 0); }
  33%  { transform: translate(-2%, 1%); }
  66%  { transform: translate(1%, -2%); }
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(74% 64% at 50% 50%, transparent 36%, rgba(0, 0, 0, 0.66) 100%);
}

/* ------------------------------ 3 boot ------------------------------ */

.boot {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: var(--bg);
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}

.app:not([data-boot]) .boot { opacity: 0; visibility: hidden; }

.boot__mark {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(var(--accent-rgb), 0.5);
  box-shadow: 0 0 30px rgba(var(--accent-rgb), 0.6), 0 0 0 8px rgba(var(--accent-rgb), 0.06) inset;
  animation: bootSpin 1.6s var(--ease-io) infinite;
}

@keyframes bootSpin {
  0%   { transform: rotate(0) scale(0.9); border-top-color: transparent; }
  100% { transform: rotate(360deg) scale(1); border-top-color: transparent; }
}

.boot__label { margin: 0; font-size: 10.5px; letter-spacing: 0.34em; text-transform: uppercase; color: var(--muted); }
.boot__label span { animation: dots 1.4s steps(4) infinite; }
@keyframes dots { to { clip-path: inset(0 0 0 100%); } }

.boot__bar { width: 168px; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.boot__bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); animation: bootBar 1.25s var(--ease) forwards; }
@keyframes bootBar { to { width: 100%; } }

/* elements rise in once the boot clears */
.app[data-boot] .topbar,
.app[data-boot] .hero,
.app[data-boot] .hud { opacity: 0; transform: translateY(14px); }

.topbar, .hero, .hud { transition: opacity 0.7s var(--ease) 0.1s, transform 0.7s var(--ease) 0.1s; }
.hero { transition-delay: 0.18s; }
.hud { transition-delay: 0.26s; }

/* ------------------------------ 4 chrome ------------------------------ */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px var(--pad) 0;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand__mark {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.16), 0 0 18px var(--accent);
}

.brand__mark::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(var(--accent-rgb), 0.5);
  animation: ping 2.8s var(--ease) infinite;
}

@keyframes ping { 0% { transform: scale(0.6); opacity: 1; } 100% { transform: scale(1.9); opacity: 0; } }

.brand__name { font-weight: 700; letter-spacing: 0.38em; }
.brand__sub { color: var(--dim); letter-spacing: 0.24em; }

.telemetry { display: flex; gap: 8px; }

.tel {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  min-width: 66px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--glass);
  backdrop-filter: blur(12px);
}

.tel b { font: 600 11.5px/1 var(--mono); letter-spacing: 0.04em; }
.tel i { font-style: normal; font-size: 8.5px; letter-spacing: 0.2em; color: var(--dim); }

.hero { padding: clamp(8px, 2vh, 24px) 6vw 0; text-align: center; pointer-events: none; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 10.5px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow__line { width: 34px; height: 1px; background: linear-gradient(90deg, transparent, var(--accent)); }

.hero h1 {
  margin: 0;
  font-size: clamp(24px, 3.7vw, 50px);
  line-height: 1.05;
  letter-spacing: -0.038em;
  font-weight: 600;
  background: linear-gradient(180deg, #fff 20%, #96a0d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__sub { margin: 10px 0 0; color: var(--muted); font-size: clamp(12px, 1.1vw, 15px); }

.app.is-detail .hero { opacity: 0; transform: translateY(-16px) scale(0.98); filter: blur(7px); }
.app.is-detail .topbar { opacity: 0.3; }
.app.is-detail .hud { opacity: 0; transform: translateY(20px); pointer-events: none; }

/* ------------------------------ 5 stage ------------------------------ */

/* Projection is done by hand in script.js: painter's-order z-index instead of
   preserve-3d, so two cards can never slice through each other. */
.stage {
  position: relative;
  cursor: grab;
  touch-action: none;
}

.stage.is-dragging { cursor: grabbing; }
.orbit, .path, .mirror { position: absolute; inset: 0; }
.path, .mirror { pointer-events: none; transition: opacity 0.4s; }

.dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.95);
  box-shadow: 0 0 9px rgba(var(--accent-rgb), 0.9);
}

.hub {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  display: grid;
  place-items: center;
  width: clamp(200px, 30vw, 350px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: opacity 0.45s;
}

.hub__glow {
  position: absolute;
  inset: -34%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.42), transparent 62%);
  filter: blur(16px);
}

.hub__ring {
  position: absolute;
  inset: 24%;
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  border-radius: 50%;
  animation: pulse 6s ease-out infinite;
}

.hub__ring--2 { animation-delay: 2s; }
.hub__ring--3 { animation-delay: 4s; }

@keyframes pulse {
  0%   { transform: scale(0.55); opacity: 0; }
  22%  { opacity: 0.75; }
  100% { transform: scale(2.05); opacity: 0; }
}

.peek-hint {
  position: absolute;
  left: 50%;
  bottom: 4%;
  padding: 7px 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(10, 12, 24, 0.8);
  backdrop-filter: blur(10px);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  transform: translate(-50%, 10px);
  opacity: 0;
  transition: opacity 0.25s, transform 0.35s var(--ease);
  pointer-events: none;
}

.peek-hint.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------ 6 cards ------------------------------ */

.card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--cw);
  height: var(--ch);
  margin: calc(var(--ch) / -2) 0 0 calc(var(--cw) / -2);
  perspective: 900px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  will-change: transform, opacity;
}

/* light the card casts into the scene */
.card::before {
  content: "";
  position: absolute;
  inset: 6% 4%;
  border-radius: 50%;
  background: var(--c1);
  filter: blur(38px);
  opacity: var(--bloom, 0);
  pointer-events: none;
}

.card__inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; }

.card__side {
  position: absolute;
  inset: 0;
  padding: calc(var(--cw) * 0.072);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: var(--radius);
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  color: var(--fg);
  background:
    radial-gradient(120% 120% at 12% 2%, rgba(255, 255, 255, 0.32), transparent 46%),
    linear-gradient(142deg, var(--c1), var(--c2));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.34) inset,
    0 0 0 1px rgba(255, 255, 255, 0.1) inset,
    0 34px 64px -24px rgba(0, 0, 0, 0.95);
}

.card__side--back { transform: rotateY(180deg); padding: 0; justify-content: flex-start; }
.card.is-flipped .card__side--front { opacity: 0; }
.card:not(.is-flipped) .card__side--back { opacity: 0; }

/* specular highlight that tracks the pointer */
.card__gloss {
  position: absolute;
  inset: 0;
  background: radial-gradient(38% 60% at var(--mx, 50%) var(--my, 30%), rgba(255, 255, 255, 0.4), transparent 70%);
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.card__art { position: absolute; inset: 0; opacity: 0.4; mix-blend-mode: soft-light; pointer-events: none; }

[data-art="circuit"] .card__art {
  background:
    linear-gradient(90deg, transparent 49.6%, rgba(255, 255, 255, 0.9) 49.6% 50.4%, transparent 50.4%) 0 0 / 26px 100%,
    linear-gradient(0deg, transparent 49.6%, rgba(255, 255, 255, 0.5) 49.6% 50.4%, transparent 50.4%) 0 0 / 100% 26px,
    radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.9) 0 2px, transparent 2px);
}

[data-art="aurora"] .card__art {
  background:
    radial-gradient(60% 90% at 15% 110%, rgba(255, 255, 255, 0.85), transparent 60%),
    radial-gradient(50% 80% at 85% -10%, rgba(255, 255, 255, 0.7), transparent 60%),
    conic-gradient(from 210deg at 60% 40%, transparent, rgba(255, 255, 255, 0.5), transparent 55%);
}

[data-art="waves"] .card__art {
  background: repeating-radial-gradient(circle at 110% 120%, rgba(255, 255, 255, 0.55) 0 1.5px, transparent 1.5px 18px);
}

[data-art="mesh"] .card__art {
  background:
    repeating-linear-gradient(58deg, rgba(255, 255, 255, 0.5) 0 1px, transparent 1px 13px),
    repeating-linear-gradient(-58deg, rgba(255, 255, 255, 0.32) 0 1px, transparent 1px 13px);
}

.card__sheen {
  position: absolute;
  inset: -60%;
  background: linear-gradient(68deg, transparent 38%, rgba(255, 255, 255, 0.32) 47%, rgba(255, 255, 255, 0.06) 54%, transparent 62%);
  animation: sweep 7.5s ease-in-out infinite;
  mix-blend-mode: overlay;
  pointer-events: none;
}

@keyframes sweep {
  0%, 62% { transform: translateX(-46%); }
  100%    { transform: translateX(46%); }
}

.card__row { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }

.card__tier { font-size: calc(var(--cw) * 0.038); font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; opacity: 0.86; }
.card__wordmark { font-size: calc(var(--cw) * 0.052); font-weight: 700; letter-spacing: 0.16em; opacity: 0.92; }

.card__chiprow { display: flex; align-items: center; gap: calc(var(--cw) * 0.045); position: relative; z-index: 1; }
.chip { width: calc(var(--cw) * 0.132); filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4)); }
.wave { width: calc(var(--cw) * 0.058); opacity: 0.78; }

.foil {
  width: calc(var(--cw) * 0.105);
  height: calc(var(--cw) * 0.078);
  margin-left: auto;
  border-radius: calc(var(--cw) * 0.016);
  background: conic-gradient(from 0deg, #ff8ad2, #8affd8, #ffe58a, #8ab4ff, #ff8ad2);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35) inset;
  opacity: 0.78;
  animation: foilSpin 9s linear infinite;
}

@keyframes foilSpin { to { filter: hue-rotate(360deg); } }

.card__num {
  position: relative;
  z-index: 1;
  font-family: var(--mono);
  font-size: calc(var(--cw) * 0.059);
  letter-spacing: 0.03em;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.22), 0 2px 3px rgba(0, 0, 0, 0.4);
}

.card__meta { display: flex; align-items: flex-end; gap: calc(var(--cw) * 0.06); position: relative; z-index: 1; margin: 0; }
.card__meta dt { margin: 0; font-size: calc(var(--cw) * 0.029); letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.6; }
.card__meta dd {
  margin: calc(var(--cw) * 0.012) 0 0;
  font-size: calc(var(--cw) * 0.046);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.card__mark { margin-left: auto; display: flex; align-items: center; }
.card__mark i { display: block; width: calc(var(--cw) * 0.09); height: calc(var(--cw) * 0.09); border-radius: 50%; background: rgba(255, 255, 255, 0.55); mix-blend-mode: screen; }
.card__mark i + i { margin-left: calc(var(--cw) * -0.037); }

.card__stripe { width: 100%; height: calc(var(--ch) * 0.2); margin-top: calc(var(--ch) * 0.1); background: linear-gradient(180deg, #15171f, #04050a); }

.card__sign {
  display: flex;
  align-items: center;
  gap: calc(var(--cw) * 0.03);
  margin: calc(var(--ch) * 0.085) calc(var(--cw) * 0.072) 0;
  padding: calc(var(--cw) * 0.022) calc(var(--cw) * 0.03);
  border-radius: 3px;
  background: repeating-linear-gradient(90deg, #eff0f6 0 6px, #e0e1ea 6px 12px);
  color: #14161d;
  font-family: var(--mono);
  font-size: calc(var(--cw) * 0.042);
}

.card__sign em { font-style: italic; font-family: "Snell Roundhand", "Segoe Script", cursive; opacity: 0.8; }
.card__sign span { margin-left: auto; font-weight: 700; letter-spacing: 0.08em; }

.card__fine {
  margin: auto calc(var(--cw) * 0.072) calc(var(--cw) * 0.06);
  font-size: calc(var(--cw) * 0.03);
  line-height: 1.5;
  letter-spacing: 0.04em;
  opacity: 0.62;
}

.card.is-frozen .card__side--front::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(122deg, rgba(255, 255, 255, 0.5) 0 1px, transparent 1px 9px),
    radial-gradient(circle at 30% 20%, rgba(222, 246, 255, 0.6), rgba(150, 205, 255, 0.28) 60%, transparent);
  backdrop-filter: blur(2px) saturate(0.5);
  animation: frostIn 0.55s var(--ease);
}

@keyframes frostIn { from { opacity: 0; transform: scale(1.1); } }

/* reflections */
.refl {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--cw);
  height: var(--ch);
  margin: calc(var(--ch) / -2) 0 0 calc(var(--cw) / -2);
  border-radius: var(--radius);
  background: linear-gradient(142deg, var(--c1), var(--c2));
  -webkit-mask-image: linear-gradient(to top, transparent 8%, #000 88%);
  mask-image: linear-gradient(to top, transparent 8%, #000 88%);
  filter: blur(5px) saturate(0.85);
  opacity: 0;
  pointer-events: none;
}

/* ------------------------------ 7 hud ------------------------------ */

.hud {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 0 var(--pad) clamp(14px, 3.2vh, 32px);
}

.hud__row { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }

.cluster, .seg {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 10px 30px -18px #000, 0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

.icobtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  transition: background 0.18s, color 0.18s, box-shadow 0.18s, transform 0.14s;
}

.icobtn:hover { background: var(--glass-2); color: var(--ink); }
.icobtn:active { transform: scale(0.94); }
.icobtn[aria-pressed="true"] { color: var(--ink); background: rgba(var(--accent-rgb), 0.2); box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.45) inset, 0 0 18px -4px rgba(var(--accent-rgb), 0.7); }

.icon { width: 14px; height: 14px; fill: currentColor; flex: none; }
.icon--play { display: none; }
#playBtn[aria-pressed="true"] .icon--play { display: block; }
#playBtn[aria-pressed="true"] .icon--pause { display: none; }

.slider { display: inline-flex; align-items: center; gap: 9px; padding: 0 12px 0 8px; }
.slider span { font-size: 9.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 78px;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.95);
}

input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--ink); }

.seg { position: relative; }

.seg__btn {
  position: relative;
  z-index: 1;
  height: 32px;
  padding: 0 15px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.24s;
}

.seg__btn.is-on { color: #0a0c16; }

.seg__pill {
  position: absolute;
  top: 5px;
  left: 5px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(120deg, #fff, #ccd4ff);
  box-shadow: 0 0 24px rgba(var(--accent-rgb), 0.65);
  transition: transform 0.45s var(--ease), width 0.45s var(--ease);
}

.swatches { display: flex; gap: 5px; padding: 0 6px; }

.sw {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  cursor: pointer;
  background: var(--sw);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset;
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}

.sw:hover { transform: scale(1.2); }
.sw.is-on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--sw), 0 0 16px var(--sw); }

.caption {
  margin: 0;
  min-height: 16px;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
  transition: color 0.25s;
}

.caption.is-active { color: var(--ink); }

/* ------------------------------ 8 detail view ------------------------------ */

.scrim {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(3, 4, 9, 0.5);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.5s;
}

.scrim.is-on { opacity: 1; }

.detail {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: min(540px, 46vw);
  height: 100%;
  border-left: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 17, 32, 0.9), rgba(5, 6, 13, 0.96));
  backdrop-filter: blur(28px) saturate(1.25);
  box-shadow: -40px 0 90px -50px #000;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.66s var(--ease), visibility 0.66s;
}

.detail.is-open { transform: none; visibility: visible; }

.detail::before {
  content: "";
  position: absolute;
  top: 0;
  left: -1px;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, var(--accent), transparent);
}

.grip { display: none; }

.detail__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px clamp(18px, 2.4vw, 32px) 8px;
}

.pager { display: flex; align-items: center; gap: 10px; }

.pager__btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.pager__btn:hover { background: var(--glass-2); color: var(--ink); }
.pager__btn:active { transform: scale(0.9); }
.pager__btn svg { width: 14px; height: 14px; }

.pager__dots { display: flex; align-items: center; gap: 5px; }

.pager__dots b {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transition: all 0.3s var(--ease);
}

.pager__dots b.is-on { width: 18px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 12px var(--accent); }

.detail__close {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.3s var(--ease);
}

.detail__close:hover { background: var(--glass-2); color: var(--ink); transform: rotate(90deg); }
.detail__close svg { width: 15px; height: 15px; }

.detail__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px clamp(18px, 2.4vw, 32px) 36px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.detail__scroll::-webkit-scrollbar { width: 6px; }
.detail__scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 3px; }

.detail.is-open .rise { animation: rise calc(0.42s + var(--i, 0) * 0.075s) var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(20px); filter: blur(7px); } }

.d-head { display: flex; align-items: flex-start; gap: 12px; }
.d-head h2 { margin: 0; font-size: clamp(25px, 2.5vw, 36px); font-weight: 600; letter-spacing: -0.032em; }
.d-head p { margin: 5px 0 0; font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }

.chip-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 25px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.chip-tag b { color: var(--ink); font-weight: 600; }
.chip-tag i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.chip-tag--live { border-color: rgba(56, 232, 210, 0.42); color: var(--accent-3); }
.chip-tag--frozen { border-color: rgba(130, 195, 255, 0.5); color: #8ec9ff; }

.d-balance { margin: 18px 0 4px; font: 600 clamp(30px, 3.3vw, 46px)/1 var(--mono); letter-spacing: -0.02em; }
.d-balance small { font-size: 0.52em; opacity: 0.55; }
.d-sub { margin: 0 0 14px; font-size: 12px; color: var(--muted); }
.d-sub b { color: var(--ink); font-weight: 600; }

.meter { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.09); overflow: hidden; }
.meter i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.85);
  transition: width 1.1s var(--ease) 0.3s;
}

/* tabs */
.tabs { position: relative; display: flex; gap: 4px; margin: 22px 0 18px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.03); }

.tab {
  position: relative;
  z-index: 1;
  flex: 1;
  height: 32px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.24s;
}

.tab.is-on { color: var(--ink); }

.tabs__pill {
  position: absolute;
  top: 4px;
  left: 4px;
  height: 32px;
  border-radius: 9px;
  background: rgba(var(--accent-rgb), 0.22);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.4) inset;
  transition: transform 0.4s var(--ease), width 0.4s var(--ease);
}

.pane { display: none; animation: fadeUp 0.45s var(--ease); }
.pane.is-on { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }

.d-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

.stat { padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255, 255, 255, 0.03); transition: border-color 0.2s, background 0.2s; }
.stat:hover { border-color: var(--line-2); background: rgba(255, 255, 255, 0.06); }
.stat dt { font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); }
.stat dd { margin: 7px 0 0; font: 600 15px/1 var(--mono); }

.d-section { margin-top: 24px; }
.d-section h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--dim);
}

.d-section h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.numline { display: flex; align-items: center; gap: 12px; }
.numline code { flex: 1; font: 500 clamp(15px, 1.8vw, 20px)/1 var(--mono); letter-spacing: 0.08em; }

/* donut */
.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut { width: 116px; height: 116px; flex: none; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 13; stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease) 0.2s; }
.legend { display: grid; gap: 9px; flex: 1; }
.legend div { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.legend i { width: 8px; height: 8px; border-radius: 3px; }
.legend b { margin-left: auto; font: 500 12px/1 var(--mono); color: var(--muted); }

/* spend bars */
.spark { display: flex; align-items: flex-end; gap: 5px; height: 78px; }
.spark span {
  flex: 1;
  border-radius: 3px 3px 2px 2px;
  background: linear-gradient(180deg, var(--accent), rgba(var(--accent-rgb), 0.16));
  transform-origin: bottom;
  animation: grow calc(0.38s + var(--i) * 0.05s) var(--ease);
  transition: filter 0.2s;
}

.spark span:last-child { background: linear-gradient(180deg, #fff, rgba(var(--accent-rgb), 0.5)); }
.spark:hover span { filter: saturate(0.4) opacity(0.45); }
.spark span:hover { filter: none; }
@keyframes grow { from { transform: scaleY(0); opacity: 0; } }

.spark-x { display: flex; justify-content: space-between; margin-top: 8px; font-size: 9px; letter-spacing: 0.18em; color: var(--dim); }

/* transactions */
.tx { display: flex; align-items: center; gap: 12px; padding: 11px 8px; margin: 0 -8px; border-radius: 10px; border-bottom: 1px solid var(--line); transition: background 0.2s; }
.tx:hover { background: rgba(255, 255, 255, 0.04); }
.tx:last-child { border-bottom: 0; }

.tx__dot {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  flex: none;
  border-radius: 11px;
  background: hsl(var(--hue) 70% 60% / 0.16);
  color: hsl(var(--hue) 82% 74%);
  font: 600 12px/1 var(--mono);
}

.tx__body { flex: 1; min-width: 0; }
.tx__m { display: block; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx__c { display: block; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.tx__a { font: 500 13px/1 var(--mono); white-space: nowrap; }
.tx__a.is-in { color: var(--accent-3); }

.perks { display: flex; flex-wrap: wrap; gap: 7px; }

/* toggles */
.rowline { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.rowline:last-of-type { border-bottom: 0; }
.rowline__t { flex: 1; }
.rowline__t b { display: block; font-size: 13.5px; font-weight: 500; }
.rowline__t span { font-size: 11px; color: var(--dim); }

.switch { position: relative; width: 44px; height: 25px; flex: none; border-radius: 999px; background: rgba(255, 255, 255, 0.12); cursor: pointer; transition: background 0.28s var(--ease); }
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.32s var(--ease);
}

.switch[aria-checked="true"] { background: linear-gradient(120deg, var(--accent), var(--accent-2)); box-shadow: 0 0 18px -4px rgba(var(--accent-rgb), 0.9); }
.switch[aria-checked="true"]::after { transform: translateX(19px); }

.limit { margin-top: 18px; }
.limit__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.limit__head b { font: 600 16px/1 var(--mono); }
.limit input[type="range"] { width: 100%; }

.d-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 17px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: background 0.2s, border-color 0.2s, transform 0.14s, box-shadow 0.2s;
}

.btn:hover { background: var(--glass-2); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn svg { width: 15px; height: 15px; fill: currentColor; }
.btn--primary { background: linear-gradient(120deg, var(--accent), var(--accent-2)); border-color: transparent; color: #080a12; font-weight: 600; box-shadow: 0 12px 30px -14px rgba(var(--accent-rgb), 0.9); }
.btn--primary:hover { filter: brightness(1.08); background: linear-gradient(120deg, var(--accent), var(--accent-2)); }
.btn--ghost { color: var(--muted); }
.btn.is-on { background: rgba(var(--accent-rgb), 0.22); border-color: rgba(var(--accent-rgb), 0.5); color: var(--ink); }

/* ------------------------------ 9 modal / toast ------------------------------ */

.modal {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 4, 9, 0.62);
  backdrop-filter: blur(9px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.32s, visibility 0.32s;
}

.modal.is-open { opacity: 1; visibility: visible; }

.modal__panel {
  width: min(450px, 92vw);
  max-height: 86vh;
  overflow-y: auto;
  padding: 28px;
  border: 1px solid var(--line-2);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(21, 23, 42, 0.97), rgba(7, 8, 17, 0.99));
  box-shadow: 0 50px 100px -34px #000;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.44s var(--ease);
}

.modal.is-open .modal__panel { transform: none; }
.modal__panel h2 { margin: 0 0 16px; font-size: 12px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--muted); }

.keys { margin: 0 0 20px; padding: 0; list-style: none; display: grid; gap: 9px; }
.keys li { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.keys li b { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.keys span { margin-left: auto; color: var(--muted); font-size: 12.5px; text-align: right; }

kbd {
  min-width: 26px;
  padding: 4px 7px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  font: 500 11px/1 var(--mono);
  text-align: center;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 30px;
  z-index: 70;
  padding: 11px 18px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(11, 13, 25, 0.94);
  backdrop-filter: blur(14px);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.42s var(--ease);
}

.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------ 10 responsive ------------------------------ */

@media (max-width: 1000px) {
  .telemetry .tel:nth-child(n + 3) { display: none; }
}

@media (max-width: 900px) {
  .hero__sub { display: none; }

  .detail {
    top: auto;
    bottom: 0;
    width: 100%;
    height: min(68%, 640px);
    border-left: 0;
    border-top: 1px solid var(--line);
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
    box-shadow: 0 -40px 90px -50px #000;
  }

  .detail::before { top: -1px; left: 0; width: 100%; height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); }

  .grip {
    display: block;
    width: 46px;
    height: 5px;
    margin: 10px auto 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    cursor: grab;
    touch-action: none;
  }

  .detail__bar { padding-top: 8px; }
}

@media (max-width: 680px) {
  .telemetry { display: none; }
  .hud__row { gap: 8px; }
  .seg__btn { padding: 0 12px; letter-spacing: 0.12em; }
  .slider { display: none; }
  .icobtn--wide span { display: none; }
  .d-grid { grid-template-columns: 1fr 1fr; }
  .donut-wrap { flex-direction: column; align-items: stretch; }
  .donut { align-self: center; }
}

@media (prefers-reduced-motion: reduce) {
  .card__sheen, .hub__ring, .foil, .floor, .grain, .aurora::before, .aurora::after,
  .brand__mark::after, .boot__mark, .boot__bar i { animation: none !important; }
  .detail.is-open .rise, .spark span, .pane { animation: none !important; }
  * { transition-duration: 0.001s !important; }
}
