/* ==========================================================================
   Exoframe Labs — components.css
   Every component in the catalogue. Mobile-first; enhancements at 768/1024.
   Press = 90ms scale(.97). Hover = 160ms lift. Borders, not blur.
   ========================================================================== */

/* ---------------------------------------------------------------------------
   Sparkle (the motif)
   ------------------------------------------------------------------------ */
.spark {
  display: inline-block;
  width: var(--spark-size, 16px);
  height: var(--spark-size, 16px);
  flex: none;
  fill: var(--spark);
  stroke: none;
  vertical-align: -0.125em;
}
.spark--12 { --spark-size: 12px; }
.spark--16 { --spark-size: 16px; }
.spark--24 { --spark-size: 24px; }
.spark--32 { --spark-size: 32px; }
.spark--48 { --spark-size: 48px; }
.spark--64 { --spark-size: 64px; }
.spark--volt { fill: var(--volt); }
.spark--ink { fill: var(--ink); }

.loader { display: inline-flex; align-items: center; gap: 6px; color: var(--spark); }
.loader .spark { --spark-size: 14px; }

/* ---------------------------------------------------------------------------
   Logo
   ------------------------------------------------------------------------ */
.logo { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--ink); min-height: var(--tap); min-width: var(--tap); }
.logo-mark,
.logo-word {
  display: inline-block;
  flex: none;
  background: currentColor;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
}
.logo-mark {
  width: var(--logo-size, 28px);
  aspect-ratio: 1;
  -webkit-mask-image: url("../assets/brand/icon-mark-160.webp");
  mask-image: url("../assets/brand/icon-mark-160.webp");
}
.logo-word {
  height: var(--logo-h, 22px);
  aspect-ratio: 1965 / 465;
  -webkit-mask-image: url("../assets/brand/studio-wordmark-400.webp");
  mask-image: url("../assets/brand/studio-wordmark-400.webp");
}
.logo__text { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; font-size: var(--t-md); }

/* ---------------------------------------------------------------------------
   0. Hero — wordmark, headline (<= 4 words), lede, CTAs, stats
   ------------------------------------------------------------------------ */
.hero { padding-block: var(--s-6) var(--s-10); }

/* ---------------------------------------------------------------------------
   0b. Dot sheet — a calm, slowly rippling lattice of ink dots on a <canvas>
   behind a host's content (the hero). Drawn by Exo's dotsheet module; static
   single frame with motion off. Ink only: no volt, no glow, no blur.
   ------------------------------------------------------------------------ */
.dotsheet-host { position: relative; isolation: isolate; }
.dotsheet-host > :not(.dotsheet) { position: relative; z-index: 1; }
.dotsheet {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent);
  mask-image: linear-gradient(to bottom, #000 70%, transparent);
}
.hero__inner { display: grid; gap: var(--s-5); justify-items: start; }
.hero__mark {
  --logo-h: clamp(28px, 4vw + 14px, 48px);
  -webkit-mask-image: url("../assets/brand/studio-wordmark-800.webp");
  mask-image: url("../assets/brand/studio-wordmark-800.webp");
  margin-bottom: var(--s-1);
}
.hero__title { max-width: 12ch; }
.hero__lede { max-width: 56ch; }
.hero__ctas { margin-top: var(--s-2); display: grid; grid-template-columns: 1fr; gap: var(--s-3); width: 100%; }
@media (min-width: 480px) {
  .hero__ctas { display: flex; flex-wrap: wrap; width: auto; }
}
.hero__stats {
  width: 100%;
  max-width: 600px;
  margin-top: var(--s-6);
  padding-top: var(--s-6);
  border-top: 1px solid var(--line);
}
@media (min-width: 768px) {
  .hero { padding-block: var(--s-11) var(--s-12); }
  .hero__inner { gap: var(--s-6); }
  .hero__mark { margin-bottom: var(--s-3); }
}

/* ---------------------------------------------------------------------------
   1. Button
   ------------------------------------------------------------------------ */
.btn {
  --btn-h: 40px;
  --btn-px: 16px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  height: var(--btn-h);
  padding: 0 var(--btn-px);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: var(--t-sm);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  background: var(--btn-bg, transparent);
  color: var(--btn-fg, var(--ink));
  box-shadow: var(--btn-shadow, none);
  transform: translateY(0) scale(1);
  transition:
    transform var(--d-fast) var(--ease-out),
    box-shadow var(--d-fast) var(--ease-out),
    background-color var(--d-fast) var(--ease-out),
    color var(--d-fast) var(--ease-out);
}
/* Invisible hit area: always at least 44px */
.btn::before {
  content: "";
  position: absolute;
  inset: min(0px, calc((var(--btn-h) - var(--tap)) / 2));
}
.btn > * { transition: opacity var(--d-fast) var(--ease-out); }

.btn--sm { --btn-h: 32px; --btn-px: 12px; font-size: var(--t-xs); border-radius: var(--r-sm); }
.btn--md { --btn-h: 40px; }
.btn--lg { --btn-h: 48px; --btn-px: 22px; font-size: var(--t-md); }
.btn--icon { width: var(--btn-h); padding: 0; }
.btn--block { width: 100%; }

.btn--primary   { --btn-bg: var(--ink);     --btn-fg: var(--paper); }
.btn--volt      { --btn-bg: var(--volt);    --btn-fg: var(--on-volt); }
.btn--secondary { --btn-bg: var(--surface); --btn-fg: var(--ink); --btn-shadow: var(--e1); }
.btn--ghost     { --btn-bg: transparent;    --btn-fg: var(--ink); }

@media (hover: hover) {
  .btn--primary:hover:not(:active):not(:disabled):not([aria-disabled="true"]):not([aria-busy="true"]),
  .btn--volt:hover:not(:active):not(:disabled):not([aria-disabled="true"]):not([aria-busy="true"]),
  .btn--secondary:hover:not(:active):not(:disabled):not([aria-disabled="true"]):not([aria-busy="true"]) {
    transform: translateY(-1px);
    box-shadow: var(--e2);
  }
  .btn--secondary:hover:not(:disabled):not([aria-disabled="true"]) { --btn-bg: var(--surface-2); }
  .btn--ghost:hover:not(:disabled):not([aria-disabled="true"]) { --btn-bg: var(--paper-2); }
}
.btn.is-hover { transform: translateY(-1px); box-shadow: var(--e2); }
.btn--secondary.is-hover { --btn-bg: var(--surface-2); }
.btn--ghost.is-hover { --btn-bg: var(--paper-2); box-shadow: none; transform: none; }

/* Press: 90ms, no lift while pressed */
.btn:active:not(:disabled):not([aria-disabled="true"]):not([aria-busy="true"]),
.btn.is-active {
  transform: scale(.97);
  box-shadow: var(--btn-shadow, none);
  transition-duration: var(--d-press);
}
.btn--volt:active:not(:disabled), .btn--volt.is-active { --btn-bg: var(--volt-deep); }
.btn--ghost:active:not(:disabled), .btn--ghost.is-active { --btn-bg: var(--paper-2); }
.btn--secondary:active:not(:disabled), .btn--secondary.is-active { --btn-bg: var(--surface-2); }

.btn.is-focus { outline: 2px solid var(--focus); outline-offset: 2px; }

.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .42;
  transform: none;
  box-shadow: var(--btn-shadow, none);
}

/* Loading: label fades, 16px spinner */
.btn .spinner { position: absolute; inset: 0; margin: auto; opacity: 0; }
.btn[aria-busy="true"] { cursor: progress; }
.btn[aria-busy="true"] > :not(.spinner) { opacity: 0; }
.btn[aria-busy="true"] > .spinner { opacity: 1; }

.spinner {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin var(--d-spin) linear infinite;
}

/* Link-style button */
.btn--link {
  --btn-h: auto;
  height: auto;
  min-height: var(--tap);
  padding: 0;
  border-radius: 0;
  font-weight: 600;
}

/* ---------------------------------------------------------------------------
   2. Link
   ------------------------------------------------------------------------ */
.link {
  color: var(--ink);
  font-weight: 500;
  background-image:
    linear-gradient(currentColor, currentColor),
    linear-gradient(var(--line-2), var(--line-2));
  background-size: 0% 1px, 100% 1px;
  background-position: 0 100%, 0 100%;
  background-repeat: no-repeat;
  padding-bottom: 1px;
  transition: background-size var(--d-base) var(--ease-out);
  border-radius: 0;
}
@media (hover: hover) { .link:hover { background-size: 100% 1px, 100% 1px; } }
.link.is-hover { background-size: 100% 1px, 100% 1px; }

.btn--link.link { background-position: 0 calc(100% - 12px), 0 calc(100% - 12px); }

.link--arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
  background-position: 0 calc(100% - 10px), 0 calc(100% - 10px);
}
.link--arrow .icon { width: 16px; height: 16px; transition: transform var(--d-fast) var(--ease-out); }
.link--arrow.is-hover .icon { transform: translateX(3px); }
.link--arrow.is-hover .icon--diag { transform: translate(2px, -2px); }
@media (hover: hover) {
  .link--arrow:hover .icon { transform: translateX(3px); }
  .link--arrow:hover .icon--diag { transform: translate(2px, -2px); }
}

/* ---------------------------------------------------------------------------
   3. Badge
   ------------------------------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-size: var(--t-xs);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  background: var(--paper-2);
  color: var(--ink);
}
.badge .spark { --spark-size: 11px; }
.badge--live     { background: var(--volt); color: var(--on-volt); }
.badge--live .spark { fill: var(--on-volt); }
.badge--soon     { background: transparent; border: 1px dashed var(--line-2); color: var(--ink-2); }
.badge--original { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.badge--slot     { background: var(--ink); color: var(--paper); }
.badge--new      { background: var(--volt-tint); border-color: var(--line-2); color: var(--ink); }
.badge--new .spark { fill: var(--ink); }

.badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.badge--live .badge__dot { animation: pulse-dot var(--d-twinkle) var(--ease-in-out) infinite; }
.badge--dot { background: transparent; padding: 0; height: auto; color: var(--ink-2); font-weight: 500; }
.badge--dot .badge__dot { width: 8px; height: 8px; }
.badge--dot.is-live .badge__dot { background: var(--volt); box-shadow: 0 0 0 1px var(--ink); }
.badge--dot.is-soon .badge__dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.badge--dot.is-success .badge__dot { background: var(--success); }
.badge--dot.is-danger .badge__dot { background: var(--danger); }

/* ---------------------------------------------------------------------------
   4. Chip
   ------------------------------------------------------------------------ */
.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--t-sm);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition:
    background-color var(--d-fast) var(--ease-out),
    border-color var(--d-fast) var(--ease-out),
    color var(--d-fast) var(--ease-out),
    transform var(--d-fast) var(--ease-out),
    gap var(--d-fast) var(--ease-out);
}
.chip::before { content: ""; position: absolute; inset: -2px; }
.chip__spark {
  width: 0;
  height: 14px;
  fill: var(--spark-on-ink);
  overflow: visible;
  opacity: 0;
  transform: scale(.4) rotate(-45deg);
  transition: width var(--d-fast) var(--ease-out), opacity var(--d-fast) var(--ease-out), transform var(--d-base) var(--ease-pop);
}
.chip__meta { color: var(--ink-2); font-size: var(--t-xs); margin-left: 6px; font-family: var(--font-mono); }

@media (hover: hover) {
  .chip:hover:not([aria-pressed="true"]):not(:disabled) { border-color: var(--ink); background: var(--surface-2); }
}
.chip.is-hover { border-color: var(--ink); background: var(--surface-2); }
.chip:active:not(:disabled), .chip.is-active { transform: scale(.94); transition-duration: var(--d-press); }

.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
  gap: 6px;
  animation: chip-pop var(--d-base) var(--ease-pop);
}
.chip[aria-pressed="true"] .chip__meta { color: inherit; opacity: .8; }
.chip[aria-pressed="true"] .chip__spark { width: 14px; opacity: 1; transform: none; }
.chip:disabled { opacity: .42; cursor: not-allowed; }

.chip-rail {
  display: flex;
  gap: var(--s-2);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding: 4px 2px;
  margin: -4px -2px;
}
.chip-rail::-webkit-scrollbar { display: none; }
.chip-rail > * { scroll-snap-align: start; flex: none; }
.chip-wrap { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* ---------------------------------------------------------------------------
   5. Card
   ------------------------------------------------------------------------ */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--e1);
  overflow: hidden;
  color: var(--ink);
}
.card__body { padding: var(--s-6); display: flex; flex-direction: column; gap: var(--s-2); flex: 1; }
.card__title { font-family: var(--font-display); font-weight: 600; font-size: var(--t-lg); letter-spacing: -0.01em; line-height: 1.3; }
.card__text { color: var(--ink-2); font-size: var(--t-sm); }
.card__media { aspect-ratio: 16 / 9; background: var(--paper-2); overflow: hidden; border-bottom: 1px solid var(--line); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-6);
  border-top: 1px solid var(--line);
  font-size: var(--t-sm);
  color: var(--ink-2);
  min-height: 56px;
}
.card--interactive {
  cursor: pointer;
  transition: transform var(--d-fast) var(--ease-out), box-shadow var(--d-fast) var(--ease-out);
}
@media (hover: hover) {
  .card--interactive:hover:not(:active) { transform: translateY(-2px); box-shadow: var(--e2); }
}
.card--interactive.is-hover { transform: translateY(-2px); box-shadow: var(--e2); }
.card--interactive:active { transform: scale(.99); transition-duration: var(--d-press); }
.card--feature .card__body { padding: var(--s-8) var(--s-6); gap: var(--s-4); }
.card--feature .card__text { font-size: var(--t-lg); max-width: var(--measure); }
.card__actions { margin-top: var(--s-2); }
/* Quiet secondary link row inside a card (e.g. "Try the games") */
.card__try { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--s-5); padding-top: var(--s-2); border-top: 1px solid var(--line); margin-top: var(--s-2); }
.card__try-label { flex-basis: 100%; font-size: var(--t-xs); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); padding-top: var(--s-2); }
@media (min-width: 480px) { .card__try-label { flex-basis: auto; padding-top: 0; } }
@media (min-width: 768px) { .card--feature .card__body { padding: var(--s-10); } }
.card__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card__link:focus-visible { outline: none; }
.card:has(.card__link:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------------------------------------------------------------------------
   6. Game tile
   ------------------------------------------------------------------------ */
.tile {
  --accent: var(--ink);
  --rx: 0deg;
  --ry: 0deg;
  --flip: 0deg;
  position: relative;
  aspect-ratio: 3 / 4;
  perspective: 900px;
  border-radius: var(--r-lg);
  isolation: isolate;
  min-width: 0;
  container: tile / inline-size;
}
.tile__inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(calc(var(--ry) + var(--flip)));
  transition: transform var(--d-slow) var(--ease-out);
  border-radius: inherit;
}
.tile.is-tilting .tile__inner { transition-duration: var(--d-fast); }
.tile.is-flipped { --flip: 180deg; }

.tile__face {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--surface);
  box-shadow: var(--e1);
  transition: box-shadow var(--d-fast) var(--ease-out);
}
@media (hover: hover) {
  .tile--live:hover .tile__face,
  .tile--original:hover .tile__face {
    box-shadow:
      0 14px 32px -14px color-mix(in srgb, var(--accent) 55%, transparent),
      0 0 0 1px color-mix(in srgb, var(--accent) 45%, var(--line-2));
  }
}
.tile.is-hover .tile__face {
  box-shadow:
    0 14px 32px -14px color-mix(in srgb, var(--accent) 55%, transparent),
    0 0 0 1px color-mix(in srgb, var(--accent) 45%, var(--line-2));
}
.tile__back { transform: rotateY(180deg); }

.tile__media { position: absolute; inset: 0; background: #080b12; }
.tile__media img { width: 100%; height: 100%; object-fit: cover; }
.tile__front::after {
  content: "";
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(to top, rgb(8 11 18 / .72), rgb(8 11 18 / 0));
  pointer-events: none;
}
.tile__badge { position: absolute; top: var(--s-3); left: var(--s-3); z-index: 2; }
.tile__logo {
  position: absolute;
  left: var(--s-3);
  bottom: var(--s-3);
  z-index: 2;
  width: 58%;
  height: auto;
  filter: drop-shadow(0 4px 10px rgb(0 0 0 / .35));
}
.tile__hint {
  position: absolute;
  right: var(--s-3);
  bottom: var(--s-3);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgb(255 255 255 / .92);
  color: #0A0A0A;
  box-shadow: 0 1px 2px rgb(0 0 0 / .2);
}
.tile__hint .icon { width: 16px; height: 16px; }

/* Full-cover flip control */
.tile__hit {
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: inherit;
  cursor: pointer;
  background: transparent;
}
.tile__hit:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

/* Stat side */
.tile__back {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-5);
  background:
    radial-gradient(120% 60% at 100% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
    var(--surface);
}
.tile__back-title { font-family: var(--font-display); font-weight: 600; font-size: var(--t-lg); letter-spacing: -0.01em; line-height: 1.2; }
.tile__stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3) var(--s-4); margin: 0; }
.tile__stats div { min-width: 0; }
.tile__stats dt { font-size: var(--t-xs); color: var(--ink-2); }
.tile__stats dd { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; font-size: var(--t-md); margin: 0; white-space: nowrap; }
.tile__mech { font-size: var(--t-xs); color: var(--ink-2); margin-top: auto; }
/* Narrow tiles (2-up on phones): stats become label/value rows */
@container tile (max-width: 219px) {
  .tile__back { padding: var(--s-3); gap: var(--s-2); }
  .tile__back-title { font-size: var(--t-md); }
  .tile__stats { grid-template-columns: 1fr; gap: 0; }
  .tile__stats div { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-2); padding: 3px 0; border-bottom: 1px solid var(--line); }
  .tile__stats dd { font-size: var(--t-xs); }
  .tile__mech { display: none; }
  .tile__name { font-size: var(--t-md); }
  .tile__tag { display: none; }
  .tile__badge { top: var(--s-2); left: var(--s-2); }
  .tile--original .tile__front { padding: var(--s-3); }
}
/* Demo links: siblings of the flip control (outside the 3D faces) so they stay
   tappable. Front: small "Play" button top-right. Back: full-width volt CTA. */
.tile__play { position: absolute; top: var(--s-3); right: var(--s-3); z-index: 6; }
.tile__cta { position: absolute; left: var(--s-5); right: var(--s-5); bottom: var(--s-5); z-index: 6; }
.tile__play,
.tile__cta { transition: opacity var(--d-fast) var(--ease-out), visibility 0s, transform var(--d-fast) var(--ease-out), box-shadow var(--d-fast) var(--ease-out), background-color var(--d-fast) var(--ease-out); }
.tile.is-flipped .tile__cta { transition-delay: var(--d-fast), 0s, 0s, 0s, 0s; }
.tile.is-flipped .tile__play,
.tile:not(.is-flipped) .tile__cta {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--d-fast) var(--ease-out), visibility 0s linear var(--d-fast);
}
.tile:has(.tile__cta) .tile__back { padding-bottom: calc(var(--s-5) + 40px + var(--s-3)); }
@container tile (max-width: 219px) {
  .tile__cta { left: var(--s-3); right: var(--s-3); bottom: var(--s-3); }
  .tile:has(.tile__cta) .tile__back { padding-bottom: calc(var(--s-3) + 40px + var(--s-2)); }
  .tile__play { top: var(--s-2); right: var(--s-2); }
}

/* Key art that already carries the game logo: drop the overlay + scrim */
.tile--logo-in-art .tile__logo,
.tile--logo-in-art .tile__front::after { display: none; }

/* Pointer sparkle */
.tile__spark,
.tile__trail {
  position: absolute;
  left: 0;
  top: 0;
  z-index: var(--z-sparkle);
  pointer-events: none;
  fill: var(--volt);
  filter: drop-shadow(0 0 1px rgb(10 10 10 / .5));
}
.tile__spark {
  width: 22px;
  height: 22px;
  opacity: 0;
  transform: translate(calc(var(--px, 50%) - 11px), calc(var(--py, 50%) - 11px)) scale(.4);
  transition: opacity var(--d-fast) var(--ease-out), transform var(--d-fast) var(--ease-pop);
}
.tile.is-tilting .tile__spark { opacity: 1; transform: translate(calc(var(--px) - 11px), calc(var(--py) - 11px)) scale(1) rotate(var(--sr, 0deg)); }
.tile__trail {
  width: 10px;
  height: 10px;
  animation: trail var(--d-slow) var(--ease-out) forwards;
}

/* Coming soon skeleton */
.tile--soon {
  border: 1.5px dashed var(--line-2);
  background:
    repeating-linear-gradient(135deg, var(--stripe) 0 8px, transparent 8px 16px),
    var(--paper-2);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--s-2);
  padding: var(--s-4);
  overflow: hidden;
}
.tile--soon .badge { position: absolute; top: var(--s-3); left: var(--s-3); }
.tile--soon .tile__soon-mark {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 40px;
  height: 40px;
  fill: var(--ink-3);
  animation: twinkle var(--d-twinkle) var(--ease-in-out) infinite;
  animation-delay: calc(var(--i, 0) * 220ms);
}

/* Original (icon tile) */
.tile--original .tile__front {
  display: flex;
  flex-direction: column;
  padding: var(--s-4);
  gap: var(--s-2);
  background:
    radial-gradient(90% 55% at 50% 30%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
    var(--surface);
}
.tile--original .tile__front::after { display: none; }
.tile--original .tile__badge { position: static; align-self: flex-start; }
.tile__icon {
  margin: auto;
  display: grid;
  place-items: center;
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--accent) 22%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--ink);
}
.tile__icon .icon { width: 28px; height: 28px; }
@container tile (min-width: 220px) {
  .tile__icon { width: 88px; height: 88px; border-radius: var(--r-xl); }
  .tile__icon .icon { width: 36px; height: 36px; }
}
.tile__name { font-family: var(--font-display); font-weight: 600; font-size: var(--t-lg); letter-spacing: -0.01em; line-height: 1.2; }
.tile__tag { font-size: var(--t-xs); color: var(--ink-2); line-height: 1.4; }

.tile-rail {
  display: grid;
  grid-auto-flow: column;
  /* one tile + gap + ~12% peek of the next, capped for large phones */
  grid-auto-columns: min(calc(100% + var(--gutter) - var(--s-4) - 12vw), 340px);
  gap: var(--s-4);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: var(--s-2) var(--gutter) var(--s-4);
  margin-inline: calc(var(--gutter) * -1);
  scroll-padding-inline: var(--gutter);
}
.tile-rail::-webkit-scrollbar { display: none; }
.tile-rail > * { scroll-snap-align: start; }
@media (min-width: 768px) {
  .tile-rail {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    padding: 0;
    margin: 0;
  }
}
@media (min-width: 1024px) {
  .tile-rail { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile-rail--5 { grid-template-columns: 1.4fr 1.4fr 1fr 1fr 1fr; align-items: end; }
}

/* ---------------------------------------------------------------------------
   7. Stat
   ------------------------------------------------------------------------ */
.stat { display: flex; flex-direction: column; gap: var(--s-1); min-width: 0; }
.stat__value {
  font-family: var(--font-mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  font-size: var(--t-2xl);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.stat__label { font-size: var(--t-sm); color: var(--ink-2); }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); }
.stat-row .stat__value { font-size: clamp(1.375rem, 6.4vw, 2.5rem); }
.stat-row > .stat + .stat { border-left: 1px solid var(--line); padding-left: var(--s-4); }

/* ---------------------------------------------------------------------------
   8. Section header
   ------------------------------------------------------------------------ */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.eyebrow .spark { --spark-size: 12px; }
.sh { display: flex; flex-direction: column; gap: var(--s-4); margin-bottom: var(--s-8); }
.sh__text { display: flex; flex-direction: column; gap: var(--s-3); max-width: 720px; }
.sh__title { font-size: var(--t-2xl); }
.sh__lede { color: var(--ink-2); font-size: var(--t-lg); max-width: var(--measure); }
@media (min-width: 768px) {
  .sh { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: var(--s-8); }
  .sh__action { flex: none; }
}

/* ---------------------------------------------------------------------------
   9. Nav
   ------------------------------------------------------------------------ */
.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: var(--paper);
  border-bottom: 1px solid transparent;
  padding-top: var(--safe-top);
  transition: border-color var(--d-fast) var(--ease-out), background-color var(--d-base) var(--ease-out);
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__inner { display: flex; align-items: center; gap: var(--s-3); height: var(--nav-h, 64px); }
.nav__links { display: none; }
.nav__end { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); }
.nav__cta { display: none; }
.nav__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 var(--s-3);
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--ink-2);
  border-radius: var(--r-sm);
  transition: color var(--d-fast) var(--ease-out);
}
.nav__link[aria-current] { color: var(--ink); }
@media (hover: hover) { .nav__link:hover { color: var(--ink); } }
@media (min-width: 768px) {
  .nav__links { display: flex; align-items: center; gap: var(--s-1); margin-left: var(--s-6); }
  .nav__menu { display: none; }
  .nav__cta { display: inline-flex; }
}

.sheet-links { list-style: none; margin: 0; padding: 0; display: grid; }
.sheet-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--t-xl);
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--line);
}

/* Theme + motion toggles */
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme]) .theme-toggle .icon-moon { display: block; }
}
.motion-toggle[aria-pressed="false"] .motion-toggle__on { display: none; }
.motion-toggle[aria-pressed="true"] .motion-toggle__off { display: none; }
.motion-toggle[aria-pressed="false"] .spark { fill: var(--ink-3); }

/* ---------------------------------------------------------------------------
   10. Inputs
   ------------------------------------------------------------------------ */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-size: var(--t-sm); font-weight: 500; color: var(--ink); }
.field__label .opt { color: var(--ink-2); font-weight: 400; }
.field__hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: var(--t-xs);
  color: var(--ink-2);
  line-height: 1.45;
}
.field__hint .icon { width: 14px; height: 14px; margin-top: 1px; }

.input, .textarea, .select select {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--t-md); /* 16px: no iOS zoom */
  line-height: 1.4;
  transition: border-color var(--d-fast) var(--ease-out), box-shadow var(--d-fast) var(--ease-out), background-color var(--d-fast) var(--ease-out);
  -webkit-appearance: none;
  appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--placeholder); opacity: 1; }
.input:hover, .textarea:hover, .select select:hover { border-color: var(--ink-3); }
.input:focus-visible, .textarea:focus-visible, .select select:focus-visible, .input.is-focus {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-color: var(--ink);
  border-radius: var(--r-md);
}
.textarea { min-height: 112px; resize: vertical; }
.input:disabled, .textarea:disabled, .select select:disabled {
  background: var(--paper-2);
  color: var(--ink-2);
  border-color: var(--line);
  cursor: not-allowed;
}
.select { position: relative; }
.select select { padding-right: 40px; cursor: pointer; }
.select .icon {
  position: absolute;
  right: 12px;
  top: 50%;
  translate: 0 -50%;
  pointer-events: none;
  color: var(--ink-2);
}

.field--error .input, .field--error .textarea, .field--error select { border-color: var(--danger); }
.field--error .field__hint { color: var(--danger-ink); }
.field--success .input, .field--success .textarea, .field--success select { border-color: var(--success); }
.field--success .field__hint { color: var(--success-ink); }

/* Checkbox + radio */
.check {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  min-height: var(--tap);
  font-size: var(--t-sm);
  cursor: pointer;
}
.check input {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1.5px solid var(--ink-3);
  border-radius: 5px;
  background: var(--surface) center / 14px 14px no-repeat;
  cursor: pointer;
  transition: background-color var(--d-fast) var(--ease-out), border-color var(--d-fast) var(--ease-out), transform var(--d-press) var(--ease-out);
}
.check input[type="radio"] { border-radius: 50%; }
.check input:hover { border-color: var(--ink); }
.check input:active { transform: scale(.9); }
.check input:checked { background-color: var(--volt); border-color: var(--on-volt); }
.check input[type="checkbox"]:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230A0A0A' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
.check input[type="checkbox"]:indeterminate {
  background-color: var(--volt);
  border-color: var(--on-volt);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230A0A0A' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E");
}
.check input[type="radio"]:checked { background-image: radial-gradient(circle, var(--on-volt) 0 3.5px, transparent 4px); }
.check input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.check input:disabled { opacity: .42; cursor: not-allowed; }
.check:has(input:disabled) { color: var(--ink-2); cursor: not-allowed; }

/* Switch 44x24 — selectors carry .check so they outrank the checkbox rules above */
.check input.switch,
input.switch {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: none;
  width: 44px;
  height: 24px;
  margin: 0;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--line-2);
  background-image: none;
  box-shadow: inset 0 0 0 1px rgb(10 10 10 / .06);
  cursor: pointer;
  transition: background-color var(--d-fast) var(--ease-out);
}
.check input.switch::before,
input.switch::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(0 0 0 / .25);
  transition: transform var(--d-fast) var(--ease-out), width var(--d-press) var(--ease-out), background-color var(--d-fast) var(--ease-out);
}
[data-theme="dark"] .check input.switch::before,
[data-theme="dark"] input.switch::before { background: #F4F4F1; }
.check input.switch:hover,
input.switch:hover { border: 0; background-color: var(--ink-3); }
.check input.switch:checked,
input.switch:checked { background-color: var(--volt); background-image: none; border: 0; }
.check input.switch:checked::before,
input.switch:checked::before { transform: translateX(20px); background: var(--on-volt); }
.check input.switch:active,
input.switch:active { transform: none; }
.check input.switch:active::before,
input.switch:active::before { width: 22px; }
.check input.switch:checked:active::before,
input.switch:checked:active::before { transform: translateX(16px); }
.check input.switch:focus-visible,
input.switch:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.check input.switch:disabled,
input.switch:disabled { opacity: .42; cursor: not-allowed; }

/* ---------------------------------------------------------------------------
   11. Tabs
   ------------------------------------------------------------------------ */
.tabs__list {
  position: relative;
  display: flex;
  gap: var(--s-1);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs__list::-webkit-scrollbar { display: none; }
.tabs__tab {
  position: relative;
  flex: none;
  min-height: var(--tap);
  padding: 0 var(--s-3);
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--ink-2);
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  transition: color var(--d-fast) var(--ease-out);
}
@media (hover: hover) { .tabs__tab:hover { color: var(--ink); } }
.tabs__tab[aria-selected="true"] { color: var(--ink); }
.tabs__tab:disabled { opacity: .42; cursor: not-allowed; }
.tabs__tab:focus-visible { outline-offset: -2px; }
.tabs__indicator {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: var(--w, 0px);
  transform: translateX(var(--x, 0px));
  background: var(--ink);
  border-radius: 2px;
  transition: transform var(--d-fast) var(--ease-in-out), width var(--d-fast) var(--ease-in-out);
}
.tabs__panel { padding-top: var(--s-5); }
.tabs__panel:focus-visible { outline-offset: 4px; }

/* ---------------------------------------------------------------------------
   12. Segmented control
   ------------------------------------------------------------------------ */
.seg {
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 3px;
  border-radius: var(--r-md);
  background: var(--paper-2);
  box-shadow: inset 0 0 0 1px var(--line);
  max-width: 100%;
}
.seg__thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: var(--w, 0px);
  transform: translateX(var(--x, 0px));
  border-radius: calc(var(--r-md) - 3px);
  background: var(--surface);
  box-shadow: var(--e1);
  transition: transform var(--d-fast) var(--ease-in-out), width var(--d-fast) var(--ease-in-out);
}
.seg__opt {
  position: relative;
  z-index: 1;
  min-height: 38px;
  padding: 0 var(--s-4);
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--ink-2);
  border-radius: calc(var(--r-md) - 3px);
  white-space: nowrap;
  transition: color var(--d-fast) var(--ease-out);
}
.seg__opt::before { content: ""; position: absolute; inset: -3px 0; }
.seg__opt[aria-checked="true"] { color: var(--ink); }
@media (hover: hover) { .seg__opt:hover { color: var(--ink); } }
.seg__opt:disabled { opacity: .42; cursor: not-allowed; }

/* ---------------------------------------------------------------------------
   13. Accordion
   ------------------------------------------------------------------------ */
.acc-group { border-top: 1px solid var(--line); }
.acc { border-bottom: 1px solid var(--line); }
.acc > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  min-height: 56px;
  padding: var(--s-3) 0;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary .icon { color: var(--ink-2); transition: transform var(--d-base) var(--ease-out); }
.acc[open] > summary .icon { transform: rotate(180deg); }
.acc.js-acc[open]:not(.is-open) > summary .icon { transform: none; }
.acc__body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows var(--d-base) var(--ease-out);
}
.acc.js-acc .acc__body { grid-template-rows: 0fr; }
.acc.js-acc.is-open .acc__body { grid-template-rows: 1fr; }
.acc__inner { overflow: hidden; min-height: 0; }
.acc__content { padding-bottom: var(--s-5); color: var(--ink-2); max-width: var(--measure); }
.acc.is-disabled > summary { color: var(--ink-2); cursor: not-allowed; }

/* ---------------------------------------------------------------------------
   14. Tooltip
   ------------------------------------------------------------------------ */
.tip { position: relative; display: inline-flex; }
.tip__bubble {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  z-index: var(--z-toast);
  translate: calc(-50% + var(--tip-shift, 0px)) 4px;
  width: max-content;
  max-width: 240px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--paper);
  font-size: var(--t-xs);
  font-weight: 500;
  line-height: 1.4;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--d-fast) var(--ease-out), translate var(--d-fast) var(--ease-out), visibility 0s linear var(--d-fast);
}
.tip__bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: calc(50% - var(--tip-shift, 0px));
  translate: -50% 0;
  border: 5px solid transparent;
  border-top-color: var(--ink);
}
.tip--bottom .tip__bubble { bottom: auto; top: calc(100% + 8px); translate: calc(-50% + var(--tip-shift, 0px)) -4px; }
.tip--bottom .tip__bubble::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--ink); }
@media (hover: hover) {
  .tip:hover .tip__bubble { opacity: 1; visibility: visible; translate: calc(-50% + var(--tip-shift, 0px)) 0; transition-delay: 0s, 0s, 0s; }
}
.tip:has(:focus-visible) .tip__bubble,
.tip.is-open .tip__bubble { opacity: 1; visibility: visible; translate: calc(-50% + var(--tip-shift, 0px)) 0; transition-delay: 0s, 0s, 0s; }
.tip.is-dismissed .tip__bubble { opacity: 0 !important; visibility: hidden !important; }

/* ---------------------------------------------------------------------------
   15. Toast
   ------------------------------------------------------------------------ */
.toast-rail {
  position: fixed;
  z-index: var(--z-toast);
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-4) max(var(--s-4), var(--safe-right)) calc(var(--s-4) + var(--safe-bottom)) max(var(--s-4), var(--safe-left));
  pointer-events: none;
}
@media (min-width: 768px) {
  .toast-rail {
    bottom: auto;
    top: 0;
    flex-direction: column;
    padding-top: calc(var(--s-4) + var(--safe-top));
  }
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: min(100%, 420px);
  min-height: 56px;
  padding: var(--s-2) var(--s-2) var(--s-2) var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--e3);
  font-size: var(--t-sm);
  touch-action: pan-y;
  transform: translateX(var(--dx, 0px));
  opacity: calc(1 - var(--drag, 0));
  animation: toast-in var(--d-base) var(--ease-pop) both;
}
.toast.is-dragging { transition: none; animation: none; }
.toast.is-settling { transition: transform var(--d-fast) var(--ease-out), opacity var(--d-fast) var(--ease-out); }
.toast.is-leaving { animation: toast-out var(--d-fast) var(--ease-out) forwards; }
.toast.is-swiped { transition: transform var(--d-fast) var(--ease-out), opacity var(--d-fast) var(--ease-out); opacity: 0; }
.toast--static { animation: none; box-shadow: var(--e2); }
.toast__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--ink);
}
.toast__icon svg { width: 14px; height: 14px; }
.toast__icon .spark { --spark-size: 14px; fill: var(--on-volt); }
.toast--volt .toast__icon { background: var(--volt); color: var(--on-volt); }
.toast--success .toast__icon { background: var(--success); color: #fff; }
[data-theme="dark"] .toast--success .toast__icon { color: #0A0A0A; }
.toast--danger .toast__icon { background: var(--danger); color: #fff; }
[data-theme="dark"] .toast--danger .toast__icon { color: #0A0A0A; }
.toast__title { flex: 1; min-width: 0; font-weight: 500; }
.toast__action { flex: none; }
.toast__close { flex: none; color: var(--ink-2); }

/* ---------------------------------------------------------------------------
   16. Modal (native <dialog>)
   ------------------------------------------------------------------------ */
.modal {
  width: min(calc(100% - 32px), 520px);
  max-width: none;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--e3);
  overflow: hidden;
  overscroll-behavior: contain;
}
.modal[open] { display: flex; flex-direction: column; animation: modal-in var(--d-base) var(--ease-out); }
.modal.is-closing { animation: modal-out var(--d-fast) var(--ease-out) forwards; }
.modal::backdrop { background: var(--scrim); animation: fade-in var(--d-base) var(--ease-out); }
.modal.is-closing::backdrop { animation: fade-out var(--d-fast) var(--ease-out) forwards; }
.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-5) var(--s-5) var(--s-3) var(--s-6);
}
.modal__title { font-family: var(--font-display); font-weight: 600; font-size: var(--t-xl); letter-spacing: -0.01em; line-height: 1.25; padding-top: 6px; }
.modal__body { padding: 0 var(--s-6) var(--s-5); overflow-y: auto; color: var(--ink-2); display: grid; gap: var(--s-4); }
.modal__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-6);
  border-top: 1px solid var(--line);
}
html:has(dialog[open]) { overflow: hidden; }

/* ---------------------------------------------------------------------------
   17. Bottom sheet (native <dialog>)
   ------------------------------------------------------------------------ */
.sheet {
  position: fixed;
  inset: auto 0 0 0;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px - var(--safe-top));
  max-height: calc(100dvh - 48px - var(--safe-top));
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--e3);
  overflow: hidden;
  overscroll-behavior: contain;
  transform: translateY(var(--sheet-dy, 0px));
}
.sheet[open] { display: flex; flex-direction: column; animation: sheet-in var(--d-slow) var(--ease-out); }
.sheet.is-dragging { animation: none; transition: none; }
.sheet.is-settling { transition: transform var(--d-base) var(--ease-out); }
.sheet.is-closing { animation: sheet-out var(--d-base) var(--ease-out) forwards; }
.sheet::backdrop { background: var(--scrim); animation: fade-in var(--d-base) var(--ease-out); }
.sheet.is-closing::backdrop { animation: fade-out var(--d-base) var(--ease-out) forwards; }
.sheet__grip {
  flex: none;
  display: grid;
  place-items: center;
  height: 28px;
  cursor: grab;
  touch-action: none;
}
.sheet__grip::before { content: ""; width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); }
.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: 0 var(--s-4) var(--s-2) var(--s-6);
  touch-action: none;
}
.sheet__title { font-family: var(--font-display); font-weight: 600; font-size: var(--t-lg); letter-spacing: -0.01em; }
.sheet__body {
  overflow-y: auto;
  padding: var(--s-2) max(var(--s-6), var(--safe-right)) calc(var(--s-6) + var(--safe-bottom)) max(var(--s-6), var(--safe-left));
  overscroll-behavior: contain;
  display: grid;
  gap: var(--s-4);
}

/* ---------------------------------------------------------------------------
   18. Marquee
   ------------------------------------------------------------------------ */
.marquee {
  position: relative;
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: var(--paper);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee var(--d-marquee) linear infinite;
}
.marquee:focus-within .marquee__track { animation-play-state: paused; }
@media (hover: hover) { .marquee:hover .marquee__track { animation-play-state: paused; } }
.marquee__group {
  display: flex;
  align-items: center;
  flex: none;
  gap: var(--s-6);
  padding: var(--s-4) var(--s-3);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--t-lg);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.marquee__group .spark { --spark-size: 14px; }
.marquee__group .t-mono { font-size: var(--t-md); }

/* ---------------------------------------------------------------------------
   19. Table
   ------------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-md); }
.table { width: 100%; font-size: var(--t-sm); }
.table caption { text-align: left; font-weight: 600; padding-bottom: var(--s-3); }
.table th, .table td { text-align: left; padding: var(--s-3) var(--s-3) var(--s-3) 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table thead th { font-size: var(--t-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); border-bottom-color: var(--line-2); }
.table tbody th { font-weight: 500; color: var(--ink-2); }
.table .num { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* ---------------------------------------------------------------------------
   20. Steps / timeline
   ------------------------------------------------------------------------ */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: step; }
.step { position: relative; display: grid; grid-template-columns: 40px 1fr; gap: var(--s-4); padding-bottom: var(--s-7); }
.step:last-child { padding-bottom: 0; }
.step::after {
  content: "";
  position: absolute;
  left: 19.5px;
  top: 44px;
  bottom: 4px;
  width: 1px;
  background: var(--line-2);
}
.step:last-child::after { display: none; }
.step__num {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--e1);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--t-sm);
}
.step.is-current .step__num { background: var(--volt); color: var(--on-volt); box-shadow: 0 0 0 1px var(--ink); }
.step.is-done .step__num { background: var(--ink); color: var(--paper); box-shadow: none; }
.step__title { font-family: var(--font-display); font-weight: 600; font-size: var(--t-lg); letter-spacing: -0.01em; line-height: 1.3; padding-top: 8px; }
.step__text { color: var(--ink-2); font-size: var(--t-sm); margin-top: var(--s-1); max-width: 40ch; }
@media (min-width: 768px) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-6); }
  .step { grid-template-columns: 1fr; gap: var(--s-3); padding-bottom: 0; }
  .step::after { left: 52px; right: calc(var(--s-6) * -1 + 8px); top: 19.5px; bottom: auto; width: auto; height: 1px; }
  .step__title { padding-top: 0; }
}

/* ---------------------------------------------------------------------------
   21. Skeleton
   ------------------------------------------------------------------------ */
.skel {
  display: block;
  border-radius: var(--r-sm);
  background:
    linear-gradient(90deg, transparent 0, var(--shimmer) 50%, transparent 100%) -150% 0 / 60% 100% no-repeat,
    var(--line);
  animation: shimmer var(--d-shimmer) var(--ease-in-out) infinite;
}
.skel--text { height: 12px; }
.skel--title { height: 20px; width: 60%; }
.skel--circle { border-radius: 50%; width: 40px; height: 40px; }
.skel--media { aspect-ratio: 16 / 9; border-radius: var(--r-md); }
.tile--soon .skel { background-color: var(--line-2); }

/* ---------------------------------------------------------------------------
   22. Divider, Kbd, Avatar / logo cell, Empty state
   ------------------------------------------------------------------------ */
.divider { border: 0; border-top: 1px solid var(--line); margin: 0; width: 100%; }
.divider--strong { border-top-color: var(--line-2); }
.divider--label,
.divider--spark {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  border: 0;
  color: var(--ink-2);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.divider--label::before, .divider--label::after,
.divider--spark::before, .divider--spark::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.divider--vertical { display: inline-block; width: 1px; height: 24px; background: var(--line-2); vertical-align: middle; }

.kbd {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  font-weight: 500;
  line-height: 1;
}

.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--av, 40px);
  height: var(--av, 40px);
  border-radius: 50%;
  background: var(--paper-2);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: calc(var(--av, 40px) * .38);
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { --av: 28px; }
.avatar--lg { --av: 56px; }
.avatar--volt { background: var(--volt); color: var(--on-volt); box-shadow: none; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--paper); }
.avatar-stack .avatar + .avatar { margin-left: -10px; }

.logo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
@media (min-width: 768px) { .logo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.logo-cell {
  display: grid;
  place-items: center;
  gap: var(--s-2);
  min-height: 96px;
  padding: var(--s-4);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  font-size: var(--t-xs);
  text-align: center;
}
.logo-cell img { max-height: 40px; width: auto; }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-8) var(--s-6);
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r-lg);
  text-align: center;
  color: var(--ink-2);
}
.empty .spark { --spark-size: 28px; fill: var(--ink-3); }
.empty__title { color: var(--ink); font-family: var(--font-display); font-weight: 600; font-size: var(--t-lg); letter-spacing: -0.01em; }
.empty__text { font-size: var(--t-sm); max-width: 36ch; }

/* ---------------------------------------------------------------------------
   23. Lobby builder
   ------------------------------------------------------------------------ */
.lobby { display: grid; gap: var(--s-5); }
.lobby__controls { display: grid; gap: var(--s-3); }
.lobby__group-label { font-size: var(--t-xs); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.lobby__frame {
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--e1);
  overflow: hidden;
}
.lobby__bar {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
  font-size: var(--t-xs);
  color: var(--ink-2);
}
.lobby__dots { display: flex; gap: 5px; }
.lobby__dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.lobby__url {
  flex: 1;
  min-width: 0;
  height: 28px;
  display: flex;
  align-items: center;
  padding: 0 var(--s-3);
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  font-family: var(--font-mono);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.lobby__body { padding: var(--s-4); display: grid; gap: var(--s-4); }
.lobby__count {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--t-sm);
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}
.lobby__count strong { color: var(--ink); font-weight: 500; font-size: var(--t-xl); letter-spacing: -0.02em; }
.lobby__count .sep { color: var(--ink-2); }
/* Phones: total on its own line, breakdown below — never a stranded separator */
@media (max-width: 479px) {
  .lobby__count strong { flex-basis: 100%; }
  .lobby__count strong + .nowrap .sep { display: none; }
}
.lobby__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-2);
  min-height: 120px;
}
@media (max-width: 359px) { .lobby__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 768px) { .lobby__grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-3); } }
@media (min-width: 1024px) { .lobby__grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.lobby__grid .empty { grid-column: 1 / -1; }
.mini {
  --accent: var(--ink);
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--r-md);
  overflow: hidden;
  background:
    radial-gradient(90% 60% at 50% 32%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    var(--paper-2);
  box-shadow: inset 0 0 0 1px var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px;
  animation: tile-in var(--d-base) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * var(--d-stagger));
}
.mini img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mini .icon { width: 30%; height: auto; aspect-ratio: 1; }
.mini__name { font-size: 11px; font-weight: 600; line-height: 1.2; text-align: center; color: var(--ink); }
.mini__tag {
  position: absolute;
  top: 5px;
  left: 5px;
  z-index: 1;
  height: 16px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  background: var(--volt);
  color: var(--on-volt);
}
.mini.is-leaving { animation: tile-out var(--d-fast) var(--ease-out) forwards; }
.lobby__foot { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-4); border-top: 1px solid var(--line); }
@media (min-width: 768px) { .lobby__foot { flex-direction: row; align-items: center; justify-content: space-between; } }

/* ---------------------------------------------------------------------------
   23b. Originals list — icon in the game's accent + name + one-line tagline
   ------------------------------------------------------------------------ */
.orig-list-head { margin: var(--s-10) 0 var(--s-4); }
.orig-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  border-top: 1px solid var(--line);
}
.orig {
  --accent: var(--ink);
  display: flex;
  align-items: center;
  gap: var(--s-4);
  min-height: 72px;
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.orig__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--accent) 22%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--ink);
}
.orig__text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.orig__play { flex: none; margin-left: auto; }
.orig__name { font-family: var(--font-display); font-weight: 600; font-size: var(--t-md); letter-spacing: -0.01em; line-height: 1.25; }
.orig__tag { font-size: var(--t-sm); color: var(--ink-2); }
@media (min-width: 768px) {
  .orig-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-8); }
}

/* ---------------------------------------------------------------------------
   24. Footer
   ------------------------------------------------------------------------ */
.footer {
  border-top: 1px solid var(--line);
  padding-block: var(--s-10) calc(var(--s-8) + var(--safe-bottom));
  font-size: var(--t-sm);
}
.footer__grid { display: grid; gap: var(--s-8); grid-template-columns: 1fr 1fr; }
.footer__brand { grid-column: 1 / -1; display: grid; gap: var(--s-3); align-content: start; }
.footer__brand p { color: var(--ink-2); max-width: 32ch; }
.footer__col h2, .footer__col h3 { font-family: var(--font-body); font-size: var(--t-xs); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); margin-bottom: var(--s-2); }
.footer__col ul { list-style: none; margin: 0; padding: 0; display: grid; }
.footer__col a { display: inline-flex; align-items: center; min-height: var(--tap); min-width: var(--tap); color: var(--ink); }
@media (hover: hover) { .footer__col a:hover { text-decoration: underline; text-underline-offset: 3px; } }
.footer__base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-top: var(--s-8);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
  color: var(--ink-2);
}
.footer__made { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px var(--s-2); min-width: 0; }
.footer__made > span + span::before { content: "·"; margin-right: var(--s-2); }
/* Phones: copyright drops under the credit, aligned with the text, no stray separator */
@media (max-width: 479px) {
  .footer__made { display: grid; grid-template-columns: auto 1fr; }
  .footer__made > span + span { grid-column: 2; }
  .footer__made > span + span::before { content: none; }
}
@media (min-width: 768px) {
  .footer__grid { grid-template-columns: 2fr 1fr 1fr; }
  .footer__brand { grid-column: auto; }
}

/* ---------------------------------------------------------------------------
   Swatch (copyable colour)
   ------------------------------------------------------------------------ */
.swatch {
  display: flex;
  flex-direction: column;
  text-align: left;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--e1);
  overflow: hidden;
  min-width: 0;
  transition: transform var(--d-fast) var(--ease-out), box-shadow var(--d-fast) var(--ease-out);
}
@media (hover: hover) { .swatch:hover:not(:active) { transform: translateY(-1px); box-shadow: var(--e2); } }
.swatch:active { transform: scale(.97); transition-duration: var(--d-press); }
.swatch__chip { height: 64px; background: var(--c); border-bottom: 1px solid var(--line); }
.swatch__meta { padding: var(--s-2) var(--s-3) var(--s-3); display: grid; gap: 2px; min-width: 0; }
.swatch__name { font-family: var(--font-mono); font-size: var(--t-xs); font-weight: 500; overflow-wrap: anywhere; }
.swatch__hex { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--ink-2); }
.swatch.is-copied .swatch__hex::after { content: " · copied"; color: var(--ink); }
