/* ==========================================================================
   coinup.lol
   Palette borrowed from block explorers rather than exchange dashboards:
   deep aubergine ink, with Bitcoin orange spent *only* on satoshi amounts
   and rank #1, so the eye reads money and position instantly.
   ========================================================================== */

:root {
  --ink:      #140E1F;
  --ink-2:    #1B1430;
  --ink-3:    #241A3D;
  --line:     #322551;
  --line-2:   #45356E;
  --text:     #EDE7F7;
  --dim:      #9C90B8;
  --orange:   #F7931A;
  --orange-d: #C2700F;
  --mint:     #4FD1A5;
  --coral:    #FF6B5E;

  --display: 'Bricolage Grotesque', 'Trebuchet MS', sans-serif;
  --body:    'Instrument Sans', system-ui, -apple-system, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, 'Cascadia Mono', monospace;

  --wrap: 1180px;
  --r: 14px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--ink);
  /* Faint vertical band, like a block column behind the page. */
  background-image:
    radial-gradient(ellipse 900px 520px at 78% -8%, rgba(247, 147, 26, .10), transparent 70%),
    radial-gradient(ellipse 700px 500px at 8% 4%, rgba(93, 63, 211, .16), transparent 68%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(var(--wrap), 100% - 2.5rem); margin-inline: auto; }

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
  border-radius: 4px;
}

.section-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  letter-spacing: -.03em;
  margin: 0;
}

.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--dim);
  margin: 0 0 1.1rem;
}

/* ------------------------------------------------------------ chain strip */

.chainstrip {
  background: #0D0916;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: .74rem;
  color: var(--dim);
}
.chainstrip__inner {
  display: flex;
  align-items: center;
  gap: .6rem;
  height: 34px;
  overflow: hidden;
  white-space: nowrap;
}
.chainstrip b { color: var(--text); font-weight: 500; }
.chainstrip__sep { color: var(--line-2); }

.pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 0 rgba(79, 209, 165, .6);
  animation: pulse 2.4s ease-out infinite;
  flex: none;
}
@keyframes pulse {
  70%  { box-shadow: 0 0 0 9px rgba(79, 209, 165, 0); }
  100% { box-shadow: 0 0 0 0 rgba(79, 209, 165, 0); }
}

/* ----------------------------------------------------------------- topbar */

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(20, 14, 31, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; height: 66px;
}

.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; }
.brand__mark {
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--orange);
  color: #180F04;
  font-family: var(--mono); font-weight: 700; font-size: 1rem;
}
.brand__name {
  font-family: var(--display); font-weight: 800; font-size: 1.28rem;
  letter-spacing: -.045em;
}
.brand__tld { color: var(--dim); font-weight: 600; }

.nav { display: flex; align-items: center; gap: 1.6rem; font-size: .92rem; }
.nav a { color: var(--dim); text-decoration: none; transition: color .15s; }
.nav a:hover { color: var(--text); }
.nav .nav__cta {
  color: var(--text);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: .42rem 1.05rem;
}
.nav .nav__cta:hover { border-color: var(--orange); color: var(--orange); }

/* ------------------------------------------------------------------- hero */

.hero {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 3.5rem;
  align-items: start;
  padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(2.5rem, 5vw, 4rem);
}

.hero__title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.7rem, 6.4vw, 4.6rem);
  line-height: .96;
  letter-spacing: -.045em;
  margin: 0 0 1.3rem;
}
.hero__one { color: var(--orange); }

.hero__sub {
  color: var(--dim);
  font-size: 1.06rem;
  max-width: 48ch;
  margin: 0 0 2.2rem;
}

/* ---------------------------------------------------------------- bid form */

.bidform {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.4rem;
}
.bidform__label {
  display: block;
  font-family: var(--mono);
  font-size: .7rem; text-transform: uppercase; letter-spacing: .14em;
  color: var(--dim);
  margin-bottom: .7rem;
}
.bidform__row { display: flex; gap: .6rem; }

.bidform__input {
  flex: 1; min-width: 0;
  background: #0F0A1A;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: .82rem 1rem;
  color: var(--text);
  font-family: var(--mono); font-size: .88rem;
}
.bidform__input::placeholder { color: #6B5F87; }
.bidform__input:focus { outline: none; border-color: var(--orange); }

.bidform__note { margin: .9rem 0 0; font-size: .82rem; color: var(--dim); }
.bidform__note b { color: var(--text); font-weight: 500; }

.bidform__error {
  margin: .8rem 0 0;
  padding: .6rem .8rem;
  border-radius: 8px;
  background: rgba(255, 107, 94, .12);
  border: 1px solid rgba(255, 107, 94, .35);
  color: #FFB3AC;
  font-size: .86rem;
}

.btn {
  font-family: var(--body); font-size: .9rem; font-weight: 600;
  border-radius: 10px;
  padding: .82rem 1.3rem;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .12s, background .15s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: progress; }

.btn--primary { background: var(--orange); color: #180F04; }
.btn--primary:hover:not([disabled]) { background: #FFA733; }

.btn--ghost { background: transparent; border-color: var(--line-2); color: var(--text); }
.btn--ghost:hover:not([disabled]) { border-color: var(--orange); color: var(--orange); }

/* ----------------------------------------------------------------- throne */

.throne {
  background: linear-gradient(158deg, #2A1D45, var(--ink-2) 62%);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: 0 26px 60px -34px rgba(0, 0, 0, .9);
}
.throne__head {
  display: flex; align-items: baseline; gap: .6rem;
  padding: .9rem 1.3rem;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 147, 26, .07);
}
.throne__rank { color: var(--orange); font-weight: 700; font-size: 1.1rem; }
.throne__label {
  font-family: var(--mono); font-size: .68rem;
  text-transform: uppercase; letter-spacing: .14em; color: var(--dim);
}
.throne__body { padding: 1.4rem; }
.throne__empty { color: var(--dim); margin: 0; font-size: .95rem; }

.throne__coin { display: flex; align-items: center; gap: .85rem; margin-bottom: 1.2rem; }
.throne__name { font-family: var(--display); font-weight: 800; font-size: 1.5rem; letter-spacing: -.03em; margin: 0; }
.throne__sym { font-family: var(--mono); font-size: .78rem; color: var(--dim); }

.throne__stack { font-family: var(--mono); font-size: 1.85rem; font-weight: 700; color: var(--orange); letter-spacing: -.03em; }
.throne__stack small { font-size: .72rem; color: var(--dim); font-weight: 400; letter-spacing: .1em; margin-left: .35rem; }
.throne__fiat { font-size: .82rem; color: var(--dim); margin: .1rem 0 1.2rem; }

.throne__take {
  border-top: 1px dashed var(--line-2);
  padding-top: 1rem;
  font-size: .84rem;
  color: var(--dim);
}
.throne__take b { display: block; font-family: var(--mono); font-size: 1.05rem; color: var(--text); margin-top: .2rem; }

.avatar {
  position: relative;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--ink-3);
  flex: none;
  display: grid; place-items: center;
  font-family: var(--mono); font-weight: 700; font-size: .85rem; color: var(--dim);
  border: 1px solid var(--line-2);
  overflow: hidden;
}
.avatar i { font-style: normal; }
/* Painted over the monogram once it arrives; transparent until then. */
.avatar img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.avatar--sm { width: 34px; height: 34px; font-size: .7rem; }

/* ----------------------------------------------------------------- ticker */

.ticker {
  border-block: 1px solid var(--line);
  background: #0D0916;
  overflow: hidden;
  padding: .55rem 0;
}
.ticker__track {
  display: flex; gap: 2.4rem;
  white-space: nowrap;
  font-family: var(--mono); font-size: .76rem; color: var(--dim);
  animation: marquee 46s linear infinite;
  width: max-content;
  padding-left: 2.4rem;
}
.ticker:hover .ticker__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

.tick__sym { color: var(--text); }
.tick__sats { color: var(--orange); }

/* ------------------------------------------------------------------ board */

.board { padding: clamp(3rem, 6vw, 4.5rem) 0 1rem; }
.board__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.6rem;
}
.board__meta { color: var(--dim); font-size: .84rem; margin: 0; }
.board__empty { color: var(--dim); text-align: center; padding: 2.5rem 0; }

.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }

/* Each row is a depth bar: the fill is this coin's stack against rank #1. */
.row {
  position: relative;
  display: grid;
  grid-template-columns: 3.2rem 1fr auto auto;
  align-items: center;
  gap: 1rem;
  padding: .95rem 1.2rem;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
}
.row::before {
  content: '';
  position: absolute; inset: 0 auto 0 0;
  width: var(--fill, 0%);
  background: linear-gradient(90deg, rgba(247, 147, 26, .16), rgba(247, 147, 26, .03));
  border-right: 1px solid rgba(247, 147, 26, .28);
  pointer-events: none;
}
.row > * { position: relative; }

.row--one { border-color: rgba(247, 147, 26, .55); background: #221733; }
.row--one::before { background: linear-gradient(90deg, rgba(247, 147, 26, .26), rgba(247, 147, 26, .05)); }

.row__rank { font-family: var(--mono); font-weight: 700; font-size: 1.05rem; color: var(--dim); }
.row--one .row__rank { color: var(--orange); }

.row__coin { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.row__name { font-weight: 600; text-decoration: none; }
.row__name:hover { color: var(--orange); }
.row__sym { font-family: var(--mono); font-size: .72rem; color: var(--dim); }
.row__blurb {
  color: var(--dim); font-size: .8rem;
  margin: .1rem 0 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 46ch;
}

.row__stack { text-align: right; }
.row__sats { font-family: var(--mono); font-weight: 700; color: var(--orange); }
.row__sub { display: block; font-size: .72rem; color: var(--dim); font-family: var(--mono); }

.row__bid {
  font-family: var(--body); font-size: .8rem; font-weight: 600;
  background: transparent; color: var(--dim);
  border: 1px solid var(--line-2); border-radius: 999px;
  padding: .42rem .95rem; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.row__bid:hover { color: var(--orange); border-color: var(--orange); }

/* -------------------------------------------------------------------- how */

.how { padding: clamp(3rem, 6vw, 4.5rem) 0; }
.steps {
  list-style: none; margin: 2rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem;
  counter-reset: step;
}
.step {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.5rem;
}
.step__n {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--ink-3); border: 1px solid var(--line-2);
  color: var(--orange); font-weight: 700; font-size: .85rem;
  margin-bottom: 1rem;
}
.step__title { font-family: var(--display); font-weight: 600; font-size: 1.1rem; margin: 0 0 .5rem; letter-spacing: -.02em; }
.step p { color: var(--dim); font-size: .9rem; margin: 0; }

/* ------------------------------------------------------------------ rules */

.rules { padding: 0 0 clamp(3rem, 6vw, 4.5rem); }
.rules__grid {
  margin-top: 2rem;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem;
}
.rule {
  border-top: 2px solid var(--line-2);
  padding-top: 1rem;
}
.rule h3 { font-family: var(--display); font-weight: 600; font-size: 1rem; margin: 0 0 .45rem; letter-spacing: -.01em; }
.rule p { color: var(--dim); font-size: .88rem; margin: 0; }

/* ----------------------------------------------------------------- footer */

.foot { border-top: 1px solid var(--line); background: #0D0916; padding: 2.5rem 0; }
.foot__inner { display: grid; gap: .7rem; }
.foot__brand { font-family: var(--display); font-weight: 800; font-size: 1.15rem; letter-spacing: -.04em; margin: 0; }
.foot__note { color: var(--dim); font-size: .82rem; max-width: 70ch; margin: 0; }
.foot__meta { margin: 0; font-size: .82rem; }
.foot__meta a { color: var(--dim); }

/* ------------------------------------------------------------------ modal */

.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 1.25rem; }
.modal[hidden] { display: none; }
.modal__scrim { position: absolute; inset: 0; background: rgba(8, 5, 14, .82); backdrop-filter: blur(4px); }
.modal__panel {
  position: relative;
  width: min(560px, 100%);
  max-height: 90vh; overflow-y: auto;
  background: var(--ink-2);
  border: 1px solid var(--line-2);
  border-radius: 18px;
  padding: 1.9rem;
  box-shadow: 0 40px 90px -40px #000;
}
.modal__x {
  position: absolute; top: .8rem; right: .9rem;
  background: none; border: none; color: var(--dim);
  font-size: 1.6rem; line-height: 1; cursor: pointer; padding: .2rem .4rem;
}
.modal__x:hover { color: var(--text); }

.sheet__title { font-family: var(--display); font-weight: 800; font-size: 1.5rem; letter-spacing: -.03em; margin: 0 0 .4rem; }
.sheet__lead { color: var(--dim); font-size: .9rem; margin: 0 0 1.4rem; }

.coinchip {
  display: flex; align-items: center; gap: .8rem;
  background: var(--ink-3); border: 1px solid var(--line);
  border-radius: 11px; padding: .8rem 1rem; margin-bottom: 1.3rem;
}
.coinchip__name { font-weight: 600; }
.coinchip__meta { font-family: var(--mono); font-size: .72rem; color: var(--dim); }

.field { display: block; margin-bottom: 1.1rem; }
.field__label {
  display: block; font-family: var(--mono); font-size: .7rem;
  text-transform: uppercase; letter-spacing: .14em; color: var(--dim); margin-bottom: .55rem;
}
.field__input {
  width: 100%;
  background: #0F0A1A; border: 1px solid var(--line-2); border-radius: 10px;
  padding: .8rem 1rem; color: var(--text);
  font-family: var(--mono); font-size: 1rem;
}
.field__input:focus { outline: none; border-color: var(--orange); }
.field__hint { font-size: .78rem; color: var(--dim); margin: .5rem 0 0; }

.presets { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.2rem; }
.preset {
  background: var(--ink-3); border: 1px solid var(--line-2); border-radius: 999px;
  padding: .45rem 1rem; color: var(--text); cursor: pointer;
  font-family: var(--body); font-size: .8rem;
}
.preset:hover { border-color: var(--orange); color: var(--orange); }
.preset b { font-family: var(--mono); }

.quote { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; margin-bottom: 1.3rem; }
.quote__cell { background: var(--ink-3); border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem; }
.quote__k { font-family: var(--mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; color: var(--dim); }
.quote__v { font-family: var(--mono); font-size: 1.05rem; font-weight: 700; margin-top: .2rem; }

/* ---------------------------------------------------------------- payment */

.pay__qr {
  display: block; width: 200px; height: 200px;
  margin: 0 auto 1.3rem;
  border-radius: 12px; border: 6px solid #fff; background: #fff;
}

.pay__amount {
  text-align: center;
  background: var(--ink-3);
  border: 1px solid rgba(247, 147, 26, .4);
  border-radius: 12px;
  padding: 1.1rem;
  margin-bottom: .5rem;
}
.pay__amount .quote__k { margin-bottom: .35rem; }
.pay__btc {
  font-family: var(--mono); font-weight: 700;
  font-size: clamp(1.3rem, 5vw, 1.75rem);
  letter-spacing: -.02em;
  word-break: break-all;
}
/* The odd satoshis on the end are the invoice number. Make them impossible to miss. */
.pay__tail {
  color: var(--orange);
  border-bottom: 2px solid var(--orange);
  padding-bottom: 1px;
}
.pay__tailnote { font-size: .78rem; color: var(--dim); margin: .9rem 0 1.3rem; text-align: center; }

.copyrow {
  display: flex; align-items: center; gap: .5rem;
  background: #0F0A1A; border: 1px solid var(--line-2); border-radius: 10px;
  padding: .6rem .6rem .6rem .9rem;
  margin-bottom: .8rem;
}
.copyrow__val {
  flex: 1; min-width: 0;
  font-family: var(--mono); font-size: .78rem;
  overflow-x: auto; white-space: nowrap; scrollbar-width: none;
}
.copyrow__val::-webkit-scrollbar { display: none; }
.copyrow__btn {
  flex: none;
  background: var(--ink-3); border: 1px solid var(--line-2); border-radius: 7px;
  color: var(--text); font-family: var(--body); font-size: .74rem; font-weight: 600;
  padding: .4rem .7rem; cursor: pointer;
}
.copyrow__btn:hover { border-color: var(--orange); color: var(--orange); }

.status {
  display: flex; align-items: center; gap: .7rem;
  border-radius: 11px; padding: .9rem 1.1rem;
  font-size: .88rem;
  margin-top: 1.2rem;
}
.status--waiting { background: rgba(156, 144, 184, .1); border: 1px solid var(--line-2); color: var(--dim); }
.status--seen    { background: rgba(247, 147, 26, .1); border: 1px solid rgba(247, 147, 26, .4); color: #FFC176; }
.status--done    { background: rgba(79, 209, 165, .1); border: 1px solid rgba(79, 209, 165, .45); color: var(--mint); }
.status--dead    { background: rgba(255, 107, 94, .1); border: 1px solid rgba(255, 107, 94, .4); color: #FFB3AC; }

.spinner {
  width: 15px; height: 15px; flex: none;
  border: 2px solid var(--line-2); border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.countdown { font-family: var(--mono); color: var(--text); }

.pay__actions { display: flex; gap: .6rem; margin-top: 1.2rem; }
.pay__actions .btn { flex: 1; }

.done { text-align: center; padding: 1rem 0; }
.done__mark {
  width: 62px; height: 62px; margin: 0 auto 1.2rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(79, 209, 165, .14); border: 1px solid var(--mint);
  color: var(--mint); font-size: 1.7rem;
}
.done__rank { font-family: var(--mono); font-size: 3rem; font-weight: 700; color: var(--orange); line-height: 1; }

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

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 2.2rem; }
  .steps, .rules__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  .nav { gap: .95rem; font-size: .85rem; }
  .nav a:not(.nav__cta) { display: none; }
  .bidform__row { flex-direction: column; }
  .steps, .rules__grid, .quote { grid-template-columns: 1fr; }
  .row {
    grid-template-columns: 2.2rem 1fr auto;
    gap: .7rem;
    padding: .8rem .9rem;
  }
  .row__bid { display: none; }
  .row__blurb { display: none; }
  .chainstrip__inner { font-size: .68rem; gap: .45rem; }
  .modal__panel { padding: 1.4rem; }
}
