/* Bagwork design system. One file for every page. See site-contract.md. */

/* ============ 1. Tokens ============ */
:root {
  /* measured from the logo */
  --navy: #020038;
  --gold: #fba20f;
  --gold-soft: #f1bd66;
  --bronze: #a07239;
  --paper: #fbf9f9;

  /* derived neutrals */
  --navy-deep: #01001f;
  --navy-2: #110d4f;
  --navy-3: #211d66;
  --navy-line: #2e2a72;
  --paper-2: #f2eff0;
  --card: #ffffff;
  --line: #e0dce3;
  --line-strong: #c4bfcc;
  --ink: #020038;
  --ink-2: #4a4867;
  --ink-3: #6b6985;
  --on-navy: #fbf9f9;
  --on-navy-2: #b4b2d0;
  --on-navy-3: #8f8cb5;
  --gold-wash: #fcebc9;
  --bronze-deep: #7a4f1c;
  --bronze-wash: #f6ece0;
  --dot: rgba(2, 0, 56, 0.15);
  --dot-dark: rgba(251, 249, 249, 0.13);
  --pattern-ink: rgba(2, 0, 56, 0.16);
  --focus: var(--navy);

  /* type */
  --font-display: 'Anybody', 'Rubik', system-ui, sans-serif;
  --font-body: 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 15px;
  --fs-md: 17px;
  --fs-lg: 20px;
  --fs-xl: 26px;
  --fs-2xl: 34px;
  --fs-3xl: 48px;
  --fs-4xl: 68px;
  --fs-hero: clamp(52px, 5.4vw, 78px);
  --wide: 122%;
  --wider: 125%;

  /* spacing */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;

  /* radii by hierarchy */
  --r-chip: 6px;
  --r-control: 10px;
  --r-panel: 14px;
  --r-slip: 20px;
  --r-stage: 32px;

  /* shadows: only slips, the vault ticket and popovers carry one */
  --sh-slip: 0 1px 0 rgba(2, 0, 56, 0.06), 0 26px 40px -26px rgba(2, 0, 56, 0.55);
  --sh-slip-dark: 0 1px 0 rgba(0, 0, 0, 0.2), 0 30px 44px -24px rgba(0, 0, 0, 0.7);
  --sh-pop: 0 14px 36px -14px rgba(2, 0, 56, 0.42);

  /* motion */
  --t-fast: 120ms;
  --t-base: 200ms;
  --t-slow: 460ms;
  --t-step: 90ms;
  --t-roll: 900ms;
  --t-play: 1400ms;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-spring: cubic-bezier(0.3, 1.35, 0.5, 1);

  --container: 1240px;
  --gutter: 40px;
}

@media (max-width: 1199px) {
  :root { --gutter: 32px; }
}

/* ============ 2. Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 1024px;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3, h4 { color: var(--ink); font-weight: 600; line-height: 1.15; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
code, kbd, samp { font-family: var(--font-mono); }
table { border-collapse: separate; border-spacing: 0; }
[hidden] { display: none !important; }
::selection { background: var(--gold-soft); color: var(--navy); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.section--stage, .panel--stage, .site-footer, .ticket, .on-navy { --focus: var(--gold); }

.skip-link {
  position: absolute; left: var(--s-4); top: -60px; z-index: 100;
  padding: var(--s-2) var(--s-4); background: var(--navy); color: var(--paper);
  border-radius: var(--r-control); text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: var(--s-4); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ============ 3. Type ============ */
.display, .h-hero, .h1, .h2, .h3, .figure {
  font-family: var(--font-display);
  font-stretch: var(--wide);
  color: var(--ink);
}
.h-hero {
  font-size: var(--fs-hero);
  font-weight: 900;
  font-stretch: var(--wider);
  line-height: 0.92;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.h1 { font-size: var(--fs-3xl); font-weight: 880; line-height: 0.98; letter-spacing: -0.03em; text-wrap: balance; }
.h2 { font-size: var(--fs-2xl); font-weight: 850; line-height: 1.02; letter-spacing: -0.025em; text-wrap: balance; }
.h3 { font-size: var(--fs-lg); font-weight: 800; line-height: 1.15; letter-spacing: -0.015em; font-stretch: 112%; }
.h4 { font-family: var(--font-body); font-size: var(--fs-base); font-weight: 600; color: var(--ink); }
.lede { font-size: var(--fs-md); line-height: 1.55; color: var(--ink-2); max-width: 56ch; }
.body { font-size: var(--fs-base); max-width: 60ch; }
.small { font-size: var(--fs-sm); line-height: 1.5; }
.muted { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
.figure { font-weight: 850; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; font-stretch: 112%; }
.figure--lg { font-size: 52px; }
.figure--md { font-size: var(--fs-2xl); }
.figure--sm { font-size: var(--fs-xl); }
.unit { font-family: var(--font-body); font-size: 0.42em; font-weight: 500; letter-spacing: 0; margin-left: 0.25em; color: var(--ink-3); }
.addr { font-family: var(--font-mono); font-size: 0.92em; letter-spacing: -0.01em; color: var(--ink-2); white-space: nowrap; }
.on-dark { color: var(--on-navy); }
.on-dark-muted { color: var(--on-navy-2); }
.section--stage .h1, .section--stage .h2, .section--stage .h3, .section--stage .figure,
.panel--stage .h1, .panel--stage .h2, .panel--stage .h3, .panel--stage .figure { color: var(--on-navy); }
.section--stage .unit, .panel--stage .unit { color: var(--on-navy-2); }
.section--stage .addr, .panel--stage .addr { color: var(--on-navy-2); }

/* ============ 4. Layout ============ */
.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.section { position: relative; padding: var(--s-9) 0; }
.section--tight { padding: var(--s-8) 0; }
.section--app { padding: 28px 0 var(--s-8); }
.section--app + .section--app { padding-top: 0; }
.section--sunk { background: var(--paper-2); }
.section--stage { background: var(--navy); color: var(--on-navy-2); }

.dotgrid {
  background-image: radial-gradient(circle, var(--dot) 1.1px, transparent 1.6px);
  background-size: 22px 22px;
  background-position: 11px 11px;
}
.dotgrid--dark {
  background-image: radial-gradient(circle, var(--dot-dark) 1.1px, transparent 1.6px);
  background-size: 22px 22px;
  background-position: 11px 11px;
}

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s-5); align-items: start; }
.col-3 { grid-column: span 3; } .col-4 { grid-column: span 4; } .col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; } .col-7 { grid-column: span 7; } .col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; } .col-12 { grid-column: span 12; }
.stack { display: flex; flex-direction: column; gap: var(--s-4); }
.stack--sm { gap: var(--s-2); }
.stack--lg { gap: var(--s-5); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.split { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-6); padding: var(--s-6) 0 var(--s-5); }
.page-head .lede { margin-top: var(--s-3); }

.split-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s-7); align-items: end; margin-bottom: var(--s-7); }
.split-head .lede { justify-self: end; }

/* ============ 5. Header ============ */
.site-header { position: relative; z-index: 20; }
.nav { display: flex; align-items: center; gap: var(--s-6); height: 88px; }
.nav__brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); border-radius: var(--r-control); }
.nav__brand img { width: 36px; height: 36px; border-radius: 9px; }
.nav__brand span { font-family: var(--font-display); font-weight: 880; font-stretch: var(--wider); font-size: 21px; letter-spacing: -0.03em; }
.nav__links { display: flex; gap: var(--s-1); margin-left: var(--s-4); }
body[data-page="home"] .wallet { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); }
.nav__link {
  position: relative; padding: 8px 14px; border-radius: var(--r-control);
  font-weight: 500; color: var(--ink-2); text-decoration: none;
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.nav__link:hover { color: var(--ink); background: var(--paper-2); }
.nav__link[aria-current='page'] { color: var(--ink); font-weight: 600; }
.nav__link[aria-current='page']::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--navy);
}
.account-chip {
  margin-left: auto; display: inline-flex; align-items: center; gap: 10px;
  padding: 5px 14px 5px 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  text-decoration: none; font-size: var(--fs-sm); color: var(--ink);
  transition: border-color var(--t-fast) var(--ease);
}
.account-chip:hover { border-color: var(--line-strong); }
.account-chip__mark {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--navy); color: var(--gold); font-weight: 600; font-size: 11px;
}
.account-chip__handle { font-weight: 600; }
.account-chip__wallet { color: var(--ink-3); font-size: 12px; }

/* ============ 6. Footer ============ */
.site-footer { position: relative; overflow: hidden; background: var(--navy); color: var(--on-navy-2); padding-top: var(--s-8); }
.site-footer::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle, var(--dot-dark) 1.1px, transparent 1.6px);
  background-size: 22px 22px; background-position: 11px 11px; pointer-events: none;
}
.footer__inner { position: relative; display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; gap: var(--s-4) var(--s-7); align-items: center; padding-bottom: var(--s-6); border-bottom: 1px solid var(--navy-line); }
.footer__brand { display: inline-flex; align-items: center; gap: 10px; color: var(--on-navy); text-decoration: none; }
.footer__brand img { width: 28px; height: 28px; border-radius: 7px; }
.footer__brand span { font-family: var(--font-display); font-weight: 880; font-stretch: var(--wider); font-size: 18px; letter-spacing: -0.03em; }
.footer__nav { display: flex; gap: var(--s-5); justify-self: center; }
.footer__nav a { color: var(--on-navy-2); text-decoration: none; font-size: var(--fs-sm); }
.footer__nav a:hover { color: var(--on-navy); text-decoration: underline; text-underline-offset: 4px; }
.footer__note { grid-column: 1 / 3; font-size: var(--fs-sm); color: var(--on-navy-3); }
.footer__copy { grid-column: 3; grid-row: 1; font-size: var(--fs-sm); color: var(--on-navy-3); justify-self: end; }
.footer__wordmark {
  position: relative;
  font-family: var(--font-display); font-weight: 900; font-stretch: var(--wider);
  font-size: clamp(130px, 14vw, 250px); line-height: 0.82; letter-spacing: -0.045em;
  color: transparent; -webkit-text-stroke: 1.5px var(--navy-3);
  text-align: center; white-space: nowrap; padding-top: var(--s-5); margin-bottom: -0.1em;
  user-select: none;
}

/* ============ 7. Buttons ============ */
.btn {
  --edge: var(--navy-deep);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border: 1.5px solid transparent; border-radius: var(--r-control);
  font-family: var(--font-body); font-size: var(--fs-base); font-weight: 600; line-height: 1;
  text-decoration: none; white-space: nowrap; cursor: pointer; user-select: none;
  box-shadow: 0 3px 0 var(--edge);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.btn:active:not(:disabled):not([aria-busy='true']) { transform: translateY(2px); box-shadow: 0 1px 0 var(--edge); }
.btn--primary { background: var(--navy); color: var(--paper); }
.btn--primary:hover { background: var(--navy-3); }
.btn--accent { --edge: var(--bronze); background: var(--gold); color: var(--navy); }
.btn--accent:hover { background: #ffb02e; }
.btn--ghost { --edge: var(--navy); background: var(--card); color: var(--navy); border-color: var(--navy); }
.btn--ghost:hover { background: var(--paper-2); }
.btn--quiet { --edge: transparent; background: transparent; color: var(--ink-2); box-shadow: none; padding: 0 12px; }
.btn--quiet:hover { background: var(--paper-2); color: var(--ink); }
.btn--quiet:active:not(:disabled) { transform: none; box-shadow: none; background: var(--line); }
.btn--on-dark { --edge: var(--navy-deep); background: transparent; color: var(--on-navy); border-color: var(--on-navy-3); }
.btn--on-dark:hover { border-color: var(--on-navy); background: var(--navy-2); }
.btn--sm { height: 34px; padding: 0 14px; font-size: var(--fs-sm); border-radius: 8px; }
.btn--lg { height: 54px; padding: 0 28px; font-size: var(--fs-md); border-radius: 12px; }
.btn--icon { width: 40px; padding: 0; }
.btn--icon.btn--sm { width: 34px; }
.btn:disabled, .btn[aria-disabled='true'] { opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none; }
.btn[aria-busy='true'] { cursor: progress; opacity: 0.85; }
.btn .spinner { width: 15px; height: 15px; border-width: 2px; }
.btn--quiet .icon, .btn--ghost .icon { color: currentColor; }

.link {
  color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1.5px;
  text-underline-offset: 4px; text-decoration-color: var(--line-strong);
  transition: text-decoration-color var(--t-fast) var(--ease);
}
.link:hover { text-decoration-color: var(--navy); }

/* ============ 8. Icons ============ */
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.icon--sm { width: 14px; height: 14px; }
.icon--lg { width: 24px; height: 24px; }

/* ============ 9. Forms ============ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.field__hint { font-size: var(--fs-sm); color: var(--ink-3); }
.field__error { display: flex; align-items: flex-start; gap: 6px; font-size: var(--fs-sm); color: var(--bronze-deep); font-weight: 500; }
.field__error .icon { margin-top: 3px; }
.input {
  width: 100%; height: 44px; padding: 0 14px; border: 1.5px solid var(--line-strong); border-radius: var(--r-control);
  background: var(--card); color: var(--ink); font-size: var(--fs-base);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.input::placeholder { color: var(--ink-3); }
.input:hover { border-color: var(--ink-3); }
.input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px var(--gold-wash); }
.input:disabled { background: var(--paper-2); color: var(--ink-3); cursor: not-allowed; }
.input--mono { font-family: var(--font-mono); font-size: 14px; }
.field.is-invalid .input { border-color: var(--bronze-deep); background: var(--bronze-wash); }
.field.is-invalid .input:focus { box-shadow: 0 0 0 3px var(--bronze-wash); }
.field.is-valid .input { border-color: var(--navy); }
.input-group { display: flex; gap: var(--s-2); align-items: stretch; }
.input-group .input { flex: 1; min-width: 0; }

.select { position: relative; display: inline-block; }
.select select {
  appearance: none; height: 40px; padding: 0 36px 0 12px; border: 1.5px solid var(--line-strong);
  border-radius: var(--r-control); background: var(--card); color: var(--ink); font-size: var(--fs-sm); font-weight: 500; cursor: pointer;
}
.select::after {
  content: ''; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; margin-top: -5px;
  border-right: 1.75px solid var(--ink-2); border-bottom: 1.75px solid var(--ink-2); transform: rotate(45deg); pointer-events: none;
}
.select select:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.segmented { display: inline-flex; padding: 3px; gap: 3px; border-radius: 12px; background: var(--paper-2); border: 1px solid var(--line); }
.segmented__opt { position: relative; }
.segmented__opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented__opt span {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 14px; border-radius: 9px;
  font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.segmented__opt span em { font-style: normal; font-weight: 500; color: var(--ink-3); }
.segmented__opt:hover span { color: var(--ink); background: var(--card); }
.segmented__opt input:checked + span { background: var(--navy); color: var(--paper); }
.segmented__opt input:checked + span em { color: var(--gold-soft); }
.segmented__opt input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.segmented__opt input:disabled + span { opacity: 0.5; cursor: not-allowed; }

.preview { display: grid; gap: 6px; padding: 14px 16px; border: 1px dashed var(--line-strong); border-radius: var(--r-control); background: var(--paper); }
.preview__text { color: var(--ink); font-size: var(--fs-sm); line-height: 1.5; }
.preview__meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: var(--fs-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; }

.suggestions { display: grid; gap: 6px; }
.suggestion {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-control);
  background: var(--card); text-align: left; cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.suggestion:hover { border-color: var(--navy); background: var(--paper); }
.suggestion__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-size: var(--fs-sm); }
.suggestion__meta { font-size: var(--fs-xs); color: var(--ink-3); white-space: nowrap; }

/* ============ 10. Panels, stats ============ */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-panel); }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: 18px 20px; border-bottom: 1px solid var(--line); }
.panel__title { font-family: var(--font-display); font-stretch: 112%; font-weight: 800; font-size: 18px; letter-spacing: -0.015em; color: var(--ink); }
.panel__sub { font-size: var(--fs-sm); color: var(--ink-3); }
.panel__body { padding: 20px; }
.panel--flush .panel__body { padding: 0; }
.panel__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: 12px 20px; border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--ink-3); }

.panel--stage { background: var(--navy); border-color: var(--navy); color: var(--on-navy-2); border-radius: var(--r-slip); }
.panel--stage .panel__head, .panel--stage .panel__foot { border-color: var(--navy-line); }
.panel--stage .panel__title { color: var(--on-navy); }
.panel--stage .panel__sub, .panel--stage .panel__foot { color: var(--on-navy-3); }

.stat { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.stat__label { font-size: var(--fs-sm); color: var(--ink-3); }
.stat__value { color: var(--ink); }
.stat__sub { font-size: var(--fs-xs); color: var(--ink-3); }
.panel--stage .stat__label, .section--stage .stat__label { color: var(--on-navy-2); }
.panel--stage .stat__value, .section--stage .stat__value { color: var(--on-navy); }
.panel--stage .stat__sub, .section--stage .stat__sub { color: var(--on-navy-3); }
.stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.stats > .stat { padding: 0 var(--s-5); border-left: 1px solid var(--line); }
.stats > .stat:first-child { padding-left: 0; border-left: 0; }
.section--stage .stats > .stat, .panel--stage .stats > .stat { border-color: var(--navy-line); }

.list { display: grid; }
.list__row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-4); padding: 10px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.list__row:last-child { border-bottom: 0; }
.list__row dt, .list__key { color: var(--ink-3); }
.list__row dd, .list__value { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.panel--stage .list__row { border-color: var(--navy-line); }
.panel--stage .list__row dt, .panel--stage .list__key { color: var(--on-navy-3); }
.panel--stage .list__row dd, .panel--stage .list__value { color: var(--on-navy); }

/* ============ 11. Patterns and monograms (check-paper security patterns, CSS only) ============ */
.pattern { background-color: var(--paper-2); }
.pattern[data-pattern='stripes'] { background-image: repeating-linear-gradient(135deg, var(--pattern-ink) 0 2px, transparent 2px 11px); }
.pattern[data-pattern='grid'] {
  background-image: linear-gradient(var(--pattern-ink) 1px, transparent 1px), linear-gradient(90deg, var(--pattern-ink) 1px, transparent 1px);
  background-size: 14px 14px;
}
.pattern[data-pattern='rings'] { background-image: repeating-radial-gradient(circle at 50% 120%, transparent 0 9px, var(--pattern-ink) 9px 11px); }
.pattern[data-pattern='dots'] { background-image: radial-gradient(circle, var(--pattern-ink) 2px, transparent 2.6px); background-size: 12px 12px; }
.pattern[data-pattern='checks'] {
  background-image: conic-gradient(var(--pattern-ink) 25%, transparent 0 50%, var(--pattern-ink) 0 75%, transparent 0);
  background-size: 20px 20px;
}
.pattern[data-pattern='burst'] { background-image: repeating-conic-gradient(from 0deg at 50% 100%, var(--pattern-ink) 0 4deg, transparent 4deg 12deg); }

.monogram {
  display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%;
  overflow: hidden; border: 1px solid var(--line);
}
.monogram span {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--card);
  font-size: 10px; font-weight: 600; color: var(--ink); letter-spacing: 0.02em;
}
.monogram--lg { width: 44px; height: 44px; }
.monogram--lg span { width: 30px; height: 30px; font-size: 12px; }

.coin-logo { width: 40px; height: 40px; flex: none; border-radius: 50%; object-fit: cover; background: var(--paper-2); }

/* ============ 12. Tables ============ */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.table th {
  position: sticky; top: 0; z-index: 1; padding: 10px 12px; background: var(--card);
  border-bottom: 1px solid var(--line-strong); text-align: left; font-weight: 500; color: var(--ink-3); white-space: nowrap;
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); color: var(--ink); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color var(--t-fast) var(--ease); }
.table tbody tr:hover { background: var(--paper); }
.table .is-num { text-align: right; white-space: nowrap; }
.table .cell-strong { font-weight: 600; }
.table .cell-muted { color: var(--ink-3); }
.table tfoot td { border-top: 1px solid var(--line-strong); border-bottom: 0; font-weight: 600; background: var(--paper); }
.table tr.is-me { background: var(--gold-wash); }
.table tr.is-me:hover { background: #fae2b2; }
.table tr.is-me td { color: var(--ink); }
.table tr.is-selected { background: var(--paper-2); box-shadow: inset 3px 0 0 var(--navy); }
.table tr.is-clickable { cursor: pointer; }
.table tr.is-clickable:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.table tr.is-new td { animation: bw-flash 1.6s var(--ease) 1; }
.table--dark th { background: var(--navy-2); color: var(--on-navy-3); border-color: var(--navy-line); }
.table--dark td { color: var(--on-navy); border-color: var(--navy-line); }
.table--dark tbody tr:hover { background: var(--navy-3); }

.sort {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px; margin: -2px -4px; border: 0; border-radius: 4px;
  background: none; color: inherit; font-weight: inherit; cursor: pointer;
}
.sort:hover { color: var(--ink); }
.sort .icon { opacity: 0.5; }
th[aria-sort='ascending'] .sort, th[aria-sort='descending'] .sort { color: var(--ink); font-weight: 600; }
th[aria-sort='ascending'] .sort .icon, th[aria-sort='descending'] .sort .icon { opacity: 1; }

.post-cell { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 360px; }
.post-cell__main { display: grid; min-width: 0; }
.post-cell__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.post-cell__path { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }

/* ============ 13. Badges, chips, meters ============ */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: var(--r-chip);
  background: var(--paper-2); color: var(--ink-2); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap;
}
.badge--active { background: var(--gold-soft); color: var(--navy); }
.badge--active::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--navy); }
.badge--paused { background: var(--bronze-wash); color: var(--bronze-deep); }
.badge--me { background: var(--navy); color: var(--paper); }
.badge--counting { background: transparent; border: 1px solid var(--navy); color: var(--navy); }
.badge--paid { background: var(--gold-wash); color: var(--ink); }
.panel--stage .badge, .section--stage .badge { background: var(--navy-3); color: var(--on-navy); }
.panel--stage .badge--active, .section--stage .badge--active { background: var(--gold); color: var(--navy); }
.panel--stage .badge--paused, .section--stage .badge--paused { background: var(--bronze-wash); color: var(--bronze-deep); }

.type-chip {
  display: inline-flex; align-items: center; gap: 5px; flex: none; height: 24px; padding: 0 8px 0 6px;
  border: 1px solid var(--line); border-radius: var(--r-chip); background: var(--card);
  font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2);
}
.table--dark .type-chip, .panel--stage .type-chip { background: var(--navy-3); border-color: var(--navy-line); color: var(--on-navy); }

.meter { position: relative; height: 6px; border-radius: 3px; background: var(--paper-2); overflow: hidden; min-width: 48px; }
.meter__fill { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--navy); transition: width var(--t-slow) var(--ease); }
.meter--accent .meter__fill { background: var(--gold); }
.meter--dark { background: var(--navy-3); }
.meter--dark .meter__fill { background: var(--gold-soft); }

.chip-filter {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 10px; border-radius: 999px;
  background: var(--navy); color: var(--paper); font-size: var(--fs-xs); font-weight: 600;
}
.chip-filter button { display: grid; place-items: center; width: 20px; height: 20px; border: 0; border-radius: 50%; background: var(--navy-3); color: var(--paper); cursor: pointer; padding: 0; }
.chip-filter button:hover { background: var(--gold); color: var(--navy); }

/* ============ 14. Tabs, pager ============ */
.tabs { display: flex; gap: var(--s-1); border-bottom: 1px solid var(--line); }
.tab {
  position: relative; padding: 10px 14px; border: 0; background: none; cursor: pointer;
  font-size: var(--fs-sm); font-weight: 500; color: var(--ink-3); transition: color var(--t-fast) var(--ease);
}
.tab:hover { color: var(--ink); }
.tab[aria-selected='true'] { color: var(--ink); font-weight: 600; }
.tab[aria-selected='true']::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--navy); }
.tab__count { margin-left: 6px; font-variant-numeric: tabular-nums; color: var(--ink-3); font-weight: 500; }
.panel__head .tabs { border-bottom: 0; margin-bottom: -19px; }

.pager { display: flex; align-items: center; gap: var(--s-2); }
.pager__info { font-size: var(--fs-sm); color: var(--ink-3); font-variant-numeric: tabular-nums; min-width: 9ch; text-align: center; }
.pager__btn {
  display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--card); color: var(--ink); cursor: pointer; transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.pager__btn:hover:not(:disabled) { border-color: var(--navy); }
.pager__btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============ 15. Feed ============ */
.feed { display: grid; }
.feed__item {
  display: grid; grid-template-columns: 32px minmax(0, 1fr) auto auto; align-items: center; gap: 12px;
  padding: 10px 20px; border-bottom: 1px solid var(--line); font-size: var(--fs-sm);
}
.feed__item:last-child { border-bottom: 0; }
.feed__item.is-new { animation: bw-flash 1.6s var(--ease) 1; }
.feed__icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--paper-2); color: var(--ink); }
.feed__main { min-width: 0; }
.feed__title { color: var(--ink); font-weight: 500; }
.feed__sub { color: var(--ink-3); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed__amount { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.feed__time { color: var(--ink-3); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; min-width: 9ch; text-align: right; }
.feed__divider {
  display: flex; align-items: center; gap: 12px; padding: 8px 20px; background: var(--paper);
  border-bottom: 1px solid var(--line); font-size: var(--fs-xs); color: var(--ink-3);
}
.feed__divider::before, .feed__divider::after { content: ''; flex: 1; border-top: 1px dashed var(--line-strong); }

/* ============ 16. Stepper ============ */
.stepper { display: grid; gap: 0; counter-reset: step; }
.stepper__step { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--s-4); padding-bottom: var(--s-5); }
.stepper__step:not(:last-child)::before {
  content: ''; position: absolute; left: 19px; top: 44px; bottom: 4px; width: 2px; background: var(--line);
}
.stepper__step[data-state='done']:not(:last-child)::before { background: var(--navy); }
.stepper__marker {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1.5px solid var(--line-strong); background: var(--card); color: var(--ink-3);
  font-family: var(--font-display); font-stretch: 112%; font-weight: 850; font-size: 16px;
  transition: background-color var(--t-base) var(--ease), color var(--t-base) var(--ease), border-color var(--t-base) var(--ease);
}
.stepper__step[data-state='current'] .stepper__marker { border-color: var(--navy); color: var(--navy); box-shadow: 0 0 0 4px var(--gold-wash); }
.stepper__step[data-state='done'] .stepper__marker { background: var(--navy); border-color: var(--navy); color: var(--gold); }
.stepper__content { padding-top: 8px; min-width: 0; }
.stepper__title { font-size: var(--fs-md); font-weight: 600; color: var(--ink); }
.stepper__step[data-state='todo'] .stepper__title { color: var(--ink-3); }
.stepper__body { margin-top: var(--s-3); display: grid; gap: var(--s-3); font-size: var(--fs-sm); }

/* ============ 17. Flow diagram ============ */
.flow { display: grid; grid-template-columns: minmax(0, 1fr) 120px minmax(0, 1.15fr) 120px minmax(0, 1fr); align-items: center; }
.flow__node { display: grid; gap: 6px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--card); min-width: 0; }
.flow__node--vault { background: var(--navy); border-color: var(--navy); color: var(--on-navy-2); border-radius: var(--r-slip); padding: 24px; }
.flow__label { font-size: var(--fs-sm); color: var(--ink-3); }
.flow__value { font-family: var(--font-display); font-stretch: 112%; font-weight: 850; font-size: var(--fs-2xl); line-height: 1; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.flow__sub { font-size: var(--fs-xs); color: var(--ink-3); }
.flow__node--vault .flow__label { color: var(--on-navy-2); }
.flow__node--vault .flow__value { color: var(--on-navy); }
.flow__node--vault .flow__sub { color: var(--on-navy-3); }
.flow__pipe { position: relative; display: grid; justify-items: center; gap: 6px; padding: 0 10px; }
.flow__pipe::before {
  content: ''; width: 100%; height: 6px; border-radius: 3px;
  background: repeating-linear-gradient(90deg, var(--gold) 0 10px, transparent 10px 18px);
  background-size: 36px 6px;
}
.flow__pipe::after {
  content: ''; position: absolute; right: 4px; top: 50%; width: 10px; height: 10px; margin-top: -2px;
  border-top: 2px solid var(--gold); border-right: 2px solid var(--gold); transform: translateY(-50%) rotate(45deg);
}
.flow__pipe-label { font-size: var(--fs-xs); color: var(--ink-3); text-align: center; }
.flow.is-pulsing .flow__pipe::before { animation: bw-pipe 0.9s linear 1; }
.flow.is-pulsing .flow__node--vault { animation: bw-bump 0.6s var(--ease) 1; }
.flow.is-paused .flow__pipe::before { background: repeating-linear-gradient(90deg, var(--line-strong) 0 10px, transparent 10px 18px); }
.flow.is-paused .flow__pipe::after { border-color: var(--line-strong); }

/* ============ 18. Address box, weights ============ */
.addr-box { display: flex; align-items: center; gap: var(--s-3); padding: 8px 8px 8px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-control); background: var(--paper); }
.addr-box code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--ink); }

.weights { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-2); }
.weights__item { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--r-control); background: var(--paper-2); }
.weights__item dt { font-size: var(--fs-sm); color: var(--ink-2); }
.weights__item dd { font-family: var(--font-display); font-stretch: 112%; font-weight: 850; font-size: var(--fs-xl); line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.panel--stage .weights__item, .step-card--dark .weights__item { background: var(--navy-2); }
.panel--stage .weights__item dt, .step-card--dark .weights__item dt { color: var(--on-navy-2); }
.panel--stage .weights__item dd, .step-card--dark .weights__item dd { color: var(--gold); }

.formula { font-size: var(--fs-sm); color: var(--ink-2); }
.formula b { color: var(--ink); font-weight: 600; }

/* ============ 19. Account bar, coin picker ============ */
.account-bar { display: flex; align-items: center; gap: var(--s-6); padding: 14px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-panel); }
.account-bar__item { display: grid; gap: 2px; min-width: 0; }
.account-bar__label { font-size: var(--fs-xs); color: var(--ink-3); }
.account-bar__value { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.account-bar__end { margin-left: auto; display: flex; align-items: center; gap: var(--s-3); }

.coin-picker { display: inline-flex; gap: 6px; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper-2); }
.coin-picker__btn {
  display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 14px 0 6px; border: 1px solid transparent; border-radius: 10px;
  background: transparent; cursor: pointer; text-align: left;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.coin-picker__btn:hover { background: var(--card); }
.coin-picker__btn[aria-pressed='true'] { background: var(--card); border-color: var(--navy); box-shadow: 0 2px 0 var(--navy); }
.coin-picker__name { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--ink); line-height: 1.2; }
.coin-picker__ticker { display: block; font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.2; }

/* ============ 20. Charts ============ */
.chart { display: grid; gap: var(--s-3); }
.chart__canvas { width: 100%; min-height: 120px; }
.chart__svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart figcaption, .chart__caption { font-size: var(--fs-sm); color: var(--ink-3); }
.chart__grid { stroke: var(--line); stroke-width: 1; }
.chart__axis { stroke: var(--line-strong); stroke-width: 1; }
.chart__tick, .chart__label { fill: var(--ink-3); font-family: var(--font-body); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart__title { fill: var(--ink-2); font-family: var(--font-body); font-size: 11px; font-weight: 500; }
.chart__bar { fill: var(--navy); transition: opacity var(--t-fast) var(--ease); }
.chart__bar--accent { fill: var(--gold); }
.chart__bar--soft { fill: var(--gold-soft); }
.chart__bar--muted { fill: var(--gold-wash); stroke: var(--bronze); stroke-width: 1; stroke-dasharray: 3 2; }
.chart__svg:hover .chart__bar { opacity: 0.55; }
.chart__svg .chart__bar:hover { opacity: 1; }
.chart__line { fill: none; stroke: var(--navy); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart__area { fill: var(--gold-wash); opacity: 0.85; }
.chart__dot { fill: var(--gold); stroke: var(--navy); stroke-width: 2; }
.chart--dark .chart__grid, .chart__svg--dark .chart__grid { stroke: var(--navy-line); }
.chart--dark .chart__axis, .chart__svg--dark .chart__axis { stroke: var(--navy-3); }
.chart--dark .chart__tick, .chart--dark .chart__label, .chart__svg--dark .chart__tick, .chart__svg--dark .chart__label { fill: var(--on-navy-3); }
.chart--dark .chart__title, .chart__svg--dark .chart__title { fill: var(--on-navy-2); }
.chart__svg--dark .chart__bar { fill: var(--on-navy-2); }
.chart__svg--dark .chart__bar--accent { fill: var(--gold); }
.chart__svg--dark .chart__bar--muted { fill: var(--navy-3); stroke: var(--gold-soft); }
.chart__svg--dark .chart__line { stroke: var(--gold); }
.chart__svg--dark .chart__area { fill: var(--navy-3); }
.chart--dark figcaption { color: var(--on-navy-3); }
.legend { display: flex; flex-wrap: wrap; gap: var(--s-4); font-size: var(--fs-xs); color: var(--ink-3); }
.legend__key { display: inline-flex; align-items: center; gap: 6px; }
.legend__swatch { width: 10px; height: 10px; border-radius: 2px; background: var(--navy); }
.legend__swatch--muted { background: var(--gold-wash); border: 1px dashed var(--bronze); }
.legend__swatch--accent { background: var(--gold); }

.ring { display: inline-block; flex: none; line-height: 0; }
.ring__track { fill: none; stroke: var(--line); }
.ring__arc { fill: none; stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.ring--dark .ring__track { stroke: var(--navy-3); }
.panel--stage .ring__track, .section--stage .ring__track, .ticket .ring__track { stroke: var(--navy-3); }

.countdown { font-family: var(--font-display); font-stretch: 112%; font-weight: 850; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ============ 21. States ============ */
.state { display: grid; justify-items: center; gap: var(--s-2); padding: var(--s-7) var(--s-5); text-align: center; }
.state__icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: var(--s-2); border-radius: 50%; background: var(--paper-2); color: var(--ink); }
.state__title { font-weight: 600; color: var(--ink); font-size: var(--fs-base); }
.state__text { max-width: 44ch; font-size: var(--fs-sm); color: var(--ink-2); }
.state__action { margin-top: var(--s-3); display: flex; gap: var(--s-2); justify-content: center; }
.state--error .state__icon { background: var(--bronze-wash); color: var(--bronze-deep); }
.state--error .state__title { color: var(--bronze-deep); }
.state--loading { color: var(--ink-3); }
.state--loading .state__text { color: var(--ink-3); }
.state--on-dark .state__icon { background: var(--navy-3); color: var(--gold); }
.state--on-dark .state__title { color: var(--on-navy); }
.state--on-dark .state__text { color: var(--on-navy-2); }
.state--on-dark.state--error .state__icon { background: var(--bronze-wash); color: var(--bronze-deep); }
.state--compact { padding: var(--s-5); }

.spinner {
  display: inline-block; width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent; opacity: 0.8;
  animation: bw-spin 0.7s linear infinite;
}
.skeleton {
  display: block; height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, var(--paper-2) 0%, var(--line) 50%, var(--paper-2) 100%);
  background-size: 200% 100%; animation: bw-shimmer 1.3s linear infinite;
}
.skeleton-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--s-4); padding: 14px 20px; border-bottom: 1px solid var(--line); }

/* ============ 22. Toasts, dialog ============ */
.toast-region { position: fixed; right: 24px; bottom: 24px; z-index: 90; display: grid; gap: var(--s-2); width: 360px; pointer-events: none; }
.toast {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start;
  padding: 14px 14px 14px 16px; border-radius: 12px; background: var(--navy); color: var(--on-navy);
  box-shadow: var(--sh-pop); pointer-events: auto; font-size: var(--fs-sm); line-height: 1.45;
  animation: bw-toast-in var(--t-slow) var(--ease-spring) 1;
}
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease); }
.toast__icon { color: var(--gold); margin-top: 1px; }
.toast__title { display: block; font-weight: 600; color: var(--on-navy); }
.toast__close { display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: var(--on-navy-2); cursor: pointer; }
.toast__close:hover { background: var(--navy-3); color: var(--on-navy); }
.toast--error { background: var(--bronze-wash); color: var(--bronze-deep); border: 1px solid var(--bronze); }
.toast--error .toast__icon, .toast--error .toast__title { color: var(--bronze-deep); }
.toast--error .toast__close { color: var(--bronze-deep); }
.toast--error .toast__close:hover { background: var(--card); }

.dialog {
  width: 440px; max-width: calc(100vw - 48px); padding: 0; border: 0; border-radius: 16px;
  background: var(--card); color: var(--ink-2); box-shadow: var(--sh-pop);
}
.dialog::backdrop { background: rgba(2, 0, 56, 0.48); }
.dialog[open] { animation: bw-toast-in var(--t-slow) var(--ease-spring) 1; }
.dialog form { display: grid; gap: var(--s-3); padding: var(--s-5); }
.dialog__title { font-family: var(--font-display); font-stretch: 112%; font-weight: 850; font-size: var(--fs-xl); letter-spacing: -0.02em; color: var(--ink); }
.dialog__body { font-size: var(--fs-base); }
.dialog__actions { display: flex; justify-content: flex-end; gap: var(--s-2); margin-top: var(--s-3); }

/* ============ 23. Contract address slot ============ */
.ca-slot {
  display: inline-flex; align-items: center; gap: var(--s-4); max-width: 100%;
  padding: 8px 8px 8px 18px; border: 1.5px solid var(--navy); border-radius: var(--r-control);
  background: var(--card); box-shadow: 0 3px 0 var(--navy);
}
.ca-slot__label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); white-space: nowrap; }
.ca-slot__code {
  display: block; width: 45ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--font-mono); font-size: 14px; line-height: 34px; color: var(--ink);
  padding: 0 12px; border-radius: 6px; background: var(--paper-2);
}
.ca-slot__copy { flex: none; min-width: 92px; }

/* ============ 24. Landing: hero ============ */
.hero { padding: var(--s-7) 0 var(--s-8); }
.hero__title { max-width: none; }
.hero__grid {
  display: grid; grid-template-columns: minmax(0, 1fr) clamp(320px, 28vw, 384px);
  gap: var(--s-6); align-items: end; margin-top: var(--s-7);
}
.hero__copy { display: grid; gap: var(--s-5); align-self: start; padding-top: var(--s-2); }
.hero__copy .lede { max-width: 46ch; }
.hero__ca { margin-top: var(--s-6); display: flex; align-items: center; gap: var(--s-4); }
.site-header .hero__ca { margin-top: 0; padding-bottom: var(--s-4); }

.ticket { position: relative; padding: 20px 22px 6px; border-radius: var(--r-slip); background: var(--navy); color: var(--on-navy-2); box-shadow: var(--sh-slip); }
.ticket__top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.ticket__name { white-space: nowrap; font-family: var(--font-display); font-stretch: 112%; font-weight: 850; font-size: var(--fs-md); letter-spacing: -0.015em; color: var(--on-navy); }
.ticket__label { margin-top: var(--s-4); font-size: var(--fs-sm); color: var(--on-navy-2); }
.ticket__balance { font-size: 50px; color: var(--on-navy); }
.ticket .unit { color: var(--on-navy-2); }
.ticket__clock { display: flex; align-items: center; gap: var(--s-3); margin-top: var(--s-4); padding: 14px 0; border-top: 1px dashed var(--navy-line); border-bottom: 1px dashed var(--navy-line); }
.ticket__clock .countdown { font-size: var(--fs-xl); color: var(--on-navy); line-height: 1; }
.ticket__clock p { font-size: var(--fs-sm); }
.ticket__clock-side { margin-left: auto; text-align: right; font-size: var(--fs-sm); white-space: nowrap; }
.ticket__clock-side b { display: block; color: var(--on-navy); font-weight: 600; font-variant-numeric: tabular-nums; }
.ticket__feed-title { margin-top: 14px; font-size: var(--fs-xs); color: var(--on-navy-3); }
.ticket__feed { display: grid; margin-top: 4px; min-height: 152px; }
.ticket__fee { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--navy-2); font-size: var(--fs-sm); }
.ticket__fee:last-child { border-bottom: 0; }
.ticket__fee.is-new { animation: bw-flash-dark 1.6s var(--ease) 1; }
.ticket__fee-amt { color: var(--gold); font-weight: 600; font-variant-numeric: tabular-nums; }
.ticket__fee-who { color: var(--on-navy-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.ticket__fee-ago { color: var(--on-navy-3); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.ticket .state { padding: var(--s-5) 0; }

/* ============ 25. Landing: problem, steps ============ */
.problem { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); }
.problem-card { display: grid; align-content: start; gap: var(--s-3); padding: var(--s-5); border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--card); }
.problem-card__fig { height: 132px; margin: calc(var(--s-5) * -1) calc(var(--s-5) * -1) var(--s-2); border-bottom: 1px solid var(--line); border-radius: var(--r-panel) var(--r-panel) 0 0; background: var(--paper); overflow: hidden; }
.problem-card__fig svg { width: 100%; height: 100%; display: block; }
.problem-card p { font-size: var(--fs-base); }
.fig-ink { stroke: var(--navy); fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.fig-fill { fill: var(--navy); }
.fig-gold { fill: var(--gold); }
.fig-soft { fill: var(--gold-soft); }
.fig-line { stroke: var(--line-strong); fill: none; stroke-width: 1.5; stroke-dasharray: 3 3; }
.fig-text { fill: var(--ink-3); font-family: var(--font-body); font-size: 11px; }
.fig-text-strong { fill: var(--ink); font-family: var(--font-display); font-stretch: 112%; font-weight: 850; font-size: 22px; }
.fig-bar { fill: var(--navy); }
.fig-bar--faint { fill: var(--line-strong); }

.steps { margin: 0; padding: 0; list-style: none; }
.stepmap { position: relative; height: 240vh; margin-top: var(--s-7); }
.stepmap__pin { position: sticky; top: 0; height: 100vh; display: grid; grid-template-rows: minmax(0, 1fr) auto; padding-bottom: var(--s-6); overflow: hidden; }
.stepmap__viewport { display: grid; align-items: center; overflow: hidden; }
.stepmap__track { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5); width: min(1040px, 100% - 80px); margin: 0 auto; }
.step-card {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-4); align-items: start;
  opacity: 0.5; transition: opacity 0.25s ease, transform 0.25s ease;
}
.step-card.is-current { opacity: 1; transform: translateY(-4px); }
.step-card__num {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: var(--r-slip);
  background: var(--navy); color: var(--gold-soft); font-family: var(--font-display); font-stretch: 125%; font-weight: 900; font-size: 36px; line-height: 1;
  box-shadow: var(--sh-slip);
}
.step-card__text { display: grid; gap: var(--s-3); padding: var(--s-5); border: 1px solid var(--line); border-radius: var(--r-slip); background: var(--card); }
.step-card__text p { font-size: var(--fs-base); line-height: 1.6; }
.step-card--dark .step-card__num { background: var(--gold); color: var(--navy); }
.step-card--dark .step-card__text { background: var(--navy); border-color: var(--navy); color: var(--on-navy-2); box-shadow: var(--sh-slip); }
.step-card--dark .h2 { color: var(--on-navy); }
.step-card--dark .weights { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.step-card--dark .weights__item { padding: 8px 10px; }
.step-card--dark .weights__item dd { font-size: var(--fs-lg); }
.step-card--dark .formula { color: var(--on-navy-2); font-size: var(--fs-xs); }
.step-card--dark .formula b { color: var(--on-navy); }
.stepmap__nav { display: flex; align-items: center; gap: var(--s-5); width: min(1240px, 100% - 80px); margin: 0 auto; }
.stepmap__bar { flex: 1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.stepmap__fill { display: block; height: 100%; width: 0; background: var(--navy); border-radius: 3px; }
.stepmap__count { font-size: var(--fs-sm); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.stepmap__count b { color: var(--ink); }

/* ============ 26. Landing: live stage and the fan ============ */
.live { overflow: hidden; border-radius: var(--r-stage) var(--r-stage) 0 0; }
.live__head { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: var(--s-7); align-items: end; }
.live__head .lede { color: var(--on-navy-2); margin-top: var(--s-4); }
.live__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: var(--s-5) 0; border-top: 1px solid var(--navy-line); border-bottom: 1px solid var(--navy-line); }
.live__stats .stat { padding: 0 var(--s-5); border-left: 1px solid var(--navy-line); }
.live__stats .stat:first-child { padding-left: 0; border-left: 0; }
.live__stats .stat__value { display: flex; align-items: center; gap: 10px; }

.fan { --spread: clamp(160px, 16.5vw, 238px); position: relative; height: 500px; margin-top: var(--s-6); }
.fan__item {
  position: absolute; left: 50%; top: 44px; z-index: var(--z, 1);
  transform: translateX(-50%) translateX(calc(var(--pos) * var(--spread))) translateY(var(--drop, 0px)) rotate(calc(var(--pos) * 6.5deg));
  transition: transform var(--t-slow) var(--ease-spring);
}
.fan__item:hover, .fan__item:focus-within {
  z-index: 8;
  transform: translateX(-50%) translateX(calc(var(--pos) * var(--spread))) translateY(calc(var(--drop, 0px) - 22px)) rotate(calc(var(--pos) * 2.5deg));
}
.fan.is-dealing .fan__item { animation: bw-deal 0.8s var(--ease-spring) both; animation-delay: calc(var(--i) * 90ms + 120ms); }

.slip {
  --notch: var(--navy);
  position: relative; display: flex; flex-direction: column; width: 228px; padding: 0; overflow: visible;
  border: 1px solid var(--line); border-radius: var(--r-slip); background: var(--card); color: var(--ink);
  box-shadow: var(--sh-slip-dark); text-align: left; cursor: pointer; font: inherit;
  transition: box-shadow var(--t-base) var(--ease);
}
.slip[aria-pressed='true'] { box-shadow: var(--sh-slip-dark), 0 0 0 3px var(--gold); }
.slip__pattern { position: relative; height: 128px; margin: 10px 10px 0; border-radius: 13px; }
.slip__pic { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 13px; object-fit: contain; background: var(--paper-2); }
.slip__rank {
  position: absolute; left: 12px; bottom: -22px; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--navy);
  font-family: var(--font-display); font-stretch: var(--wider); font-weight: 900; font-size: 26px; color: var(--navy); line-height: 1;
}
.slip__rank::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; border: 1.5px dotted var(--navy); }
.slip__mono { position: absolute; right: 12px; top: 12px; padding: 3px 7px; border-radius: var(--r-chip); background: var(--card); font-size: 11px; font-weight: 600; color: var(--ink-2); }
.slip__tear { position: relative; height: 0; margin: 34px 0 0; border-top: 2px dashed var(--line-strong); }
.slip__tear::before, .slip__tear::after { content: ''; position: absolute; top: -10px; width: 18px; height: 18px; border-radius: 50%; background: var(--notch); }
.slip__tear::before { left: -10px; }
.slip__tear::after { right: -10px; }
.slip__body { display: grid; gap: 8px; padding: 14px 16px 16px; }
.slip__handle { font-weight: 600; font-size: var(--fs-base); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slip__row { display: flex; justify-content: space-between; font-size: var(--fs-sm); color: var(--ink-3); }
.slip__row b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.slip__cut { display: grid; gap: 2px; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.slip__cut-label { font-size: var(--fs-xs); color: var(--ink-3); }
.slip__cut-value { font-family: var(--font-display); font-stretch: 115%; font-weight: 900; font-size: 26px; line-height: 1; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.slip__cut-value small { font-family: var(--font-body); font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--ink-3); margin-left: 4px; }

.slip--hero { background: var(--gold); border-color: var(--gold); width: 244px; }
.slip--hero .slip__pattern { --pattern-ink: rgba(2, 0, 56, 0.2); background-color: var(--gold-soft); }
.slip--hero .slip__row, .slip--hero .slip__cut-label, .slip--hero .slip__cut-value small { color: var(--navy); }
.slip--hero .slip__tear { border-color: rgba(2, 0, 56, 0.35); }
.slip--hero .slip__cut { border-color: rgba(2, 0, 56, 0.25); }
.slip--hero[aria-pressed='true'] { box-shadow: var(--sh-slip-dark), 0 0 0 3px var(--paper); }
.slip--hero .slip__cut-value { font-size: 30px; }

.live__posts { margin-top: var(--s-5); background: var(--navy-2); border: 1px solid var(--navy-line); border-radius: var(--r-panel); }
.live__posts .panel__head { border-color: var(--navy-line); }
.live__posts .panel__title { color: var(--on-navy); }
.live__posts .panel__sub { color: var(--on-navy-3); }
.live__posts .table th { background: var(--navy-2); }
.live__posts .post-cell__path { color: var(--on-navy-3); }
.live__posts .post-cell__text { color: var(--on-navy); }
.live__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); margin-top: var(--s-5); }
.live__foot p { color: var(--on-navy-2); font-size: var(--fs-sm); }

/* ============ 27. Landing: start ============ */
.start { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: var(--s-7); align-items: end; padding: var(--s-7) 0; border-top: 2px solid var(--navy); }
.start .lede { margin-top: var(--s-4); }
.start__actions { display: grid; gap: var(--s-3); justify-items: start; }

/* ============ 28. Motion ============ */
.enter { animation: bw-enter 0.55s var(--ease) both; }
.is-bumped { animation: bw-bump 0.6s var(--ease) 1; display: inline-block; }

@keyframes bw-enter { from { opacity: 0; transform: translateY(10px); } }
@keyframes bw-deal { from { opacity: 0; transform: translateX(-50%) translateY(120px) rotate(0deg) scale(0.92); } }
@keyframes bw-flash { from { background-color: var(--gold-wash); } to { background-color: transparent; } }
@keyframes bw-flash-dark { from { background-color: var(--navy-3); } to { background-color: transparent; } }
@keyframes bw-bump { 0% { transform: none; } 35% { transform: translateY(-3px); } 100% { transform: none; } }
@keyframes bw-spin { to { transform: rotate(360deg); } }
@keyframes bw-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes bw-toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes bw-pipe { from { background-position: 0 0; } to { background-position: 36px 0; } }

/* Landing motion. index.js arms these only after it runs; every state without its classes shows the content whole. */
.ticket__drop {
  position: absolute; z-index: 2; pointer-events: none; white-space: nowrap;
  color: var(--gold); font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums;
}

.live__posts tr.is-dealt { animation: bw-deal-row var(--t-slow) var(--ease) both; animation-delay: calc(var(--i) * var(--t-step)); }

.slip__gain {
  position: absolute; right: 14px; bottom: 46px; z-index: 1; pointer-events: none; white-space: nowrap;
  padding: 2px 7px; border-radius: var(--r-chip); background: var(--gold); color: var(--navy);
  font-size: calc(11px + var(--share, 0) * 30px); font-weight: 600; font-variant-numeric: tabular-nums;
  animation: bw-gain var(--t-play) var(--ease) both;
}
.slip--hero .slip__gain { background: var(--navy); color: var(--gold); }

.footer__wordmark-fill {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
  transform: translateY(calc((1 - var(--fill, 0)) * 100%));
  transition: transform var(--t-slow) var(--ease);
}
.footer__wordmark-fill > span {
  display: block; height: 100%; padding-top: var(--s-5);
  color: var(--gold-soft); -webkit-text-stroke-color: var(--gold-soft);
  transform: translateY(calc((var(--fill, 0) - 1) * 100%));
  transition: transform var(--t-slow) var(--ease);
}

.fig-cover { fill: var(--paper); transform: translateX(186px); }
.problem-card__fig .fig-gold, .problem-card__fig .fig-bar, .problem-card__fig .fig-bar--faint { transform-box: fill-box; }
.problem-card__fig .fig-gold { transform-origin: 50% 50%; }
.problem-card__fig .fig-bar, .problem-card__fig .fig-bar--faint { transform-origin: 50% 100%; }
.problem-card__fig.is-armed .fig-cover { transform: none; }
.problem-card__fig.is-armed[data-fig='fees'] .fig-gold { opacity: 0; }
.problem-card__fig.is-armed[data-fig='payout'] svg > :not(.fig-text-strong),
.problem-card__fig.is-armed .fig-bar, .problem-card__fig.is-armed .fig-bar--faint { opacity: 0; }
.problem-card__fig.is-playing .fig-cover { animation: bw-fig-draw var(--t-play) var(--ease) both; }
.problem-card__fig.is-playing[data-fig='fees'] .fig-gold { animation: bw-fig-pop var(--t-slow) var(--ease) both; animation-delay: calc(var(--t-play) - var(--t-base)); }
.problem-card__fig.is-playing[data-fig='payout'] svg > :not(.fig-text-strong) { animation: bw-enter var(--t-slow) var(--ease) both; }
.problem-card__fig.is-playing .fig-bar, .problem-card__fig.is-playing .fig-bar--faint {
  animation: bw-fig-shrink var(--t-slow) var(--ease) both; animation-delay: calc(var(--day, 0) * var(--t-step) * 2);
}

@keyframes bw-deal-row { from { opacity: 0; transform: translateY(-10px); } }
@keyframes bw-gain { from { opacity: 0; transform: translateY(6px); } 20% { opacity: 1; } to { opacity: 0; transform: translateY(-30px); } }
@keyframes bw-fig-draw { from { transform: none; } }
@keyframes bw-fig-pop { from { opacity: 0; transform: scale(0); } }
@keyframes bw-fig-shrink { from { opacity: 0; transform: scaleY(var(--from, 1)); } 40% { opacity: 1; transform: scaleY(var(--from, 1)); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
  .spinner { animation: none; border-right-color: currentColor; opacity: 0.4; }
  .skeleton { animation: none; }
}

/* ============ 29. 1024–1199 adjustments ============ */
@media (max-width: 1199px) {
  .h1 { font-size: 42px; }
  .split-head { gap: var(--s-6); }
  .step-card__num { width: 52px; height: 52px; font-size: 30px; }
  .flow { grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1.15fr) 72px minmax(0, 1fr); }
  .account-bar { gap: var(--s-5); }
  .live__head { grid-template-columns: minmax(0, 1fr); gap: var(--s-5); }
  .live__stats .figure--md { font-size: var(--fs-xl); }
  .slip { width: 208px; }
  .slip--hero { width: 222px; }
  .slip__cut-value { font-size: 22px; }
  .slip--hero .slip__cut-value { font-size: 26px; }
}
