/* Home. The allocator is the hero and it is live, so most of this file is that
   one component. Everything animates transform, opacity or width only. */

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

.hero { padding: 76px 0 40px; }
.hero h1 { font-size: clamp(40px, 6.4vw, 76px); line-height: .95; letter-spacing: -.055em; }
.hero h1 .hl {
  background: linear-gradient(96deg, #8ff0b3, #5ddf6c 62%, #3dcc4d);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .sub {
  margin-top: 22px; max-width: 58ch;
  font-size: 15.5px; line-height: 1.62; color: var(--txt-3);
}

/* ------------------------------------------------------------- the demo */

.demo {
  background: linear-gradient(180deg, #16161b, var(--bg-2) 200px);
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  padding: 18px 20px 20px; margin-bottom: 64px;
  position: relative; overflow: hidden;
}
.demo::before {   /* a slow sheen so the panel is not a flat rectangle */
  content: ''; position: absolute; inset: -40% -10% auto; height: 220px;
  background: radial-gradient(60% 100% at 30% 0%, rgba(134, 239, 172, .07), transparent 70%);
  pointer-events: none;
}

.demo-h { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.demo-h .ml { flex: 0 0 auto; }

.preset-name { display: grid; gap: 1px; min-width: 0; }
.preset-name b { font-size: 14px; font-weight: 600; color: var(--txt-hero); letter-spacing: -.02em; }
.preset-name span { font-size: 12px; }
.preset-name.in { animation: nameIn .44s var(--ease); }
@keyframes nameIn { from { opacity: 0; transform: translateY(7px); } }

.hint {
  font: 500 10px 'Geist Mono', monospace; letter-spacing: .13em; text-transform: uppercase;
  padding: 4px 8px; border: 1px dashed var(--line-3); border-radius: var(--r-xs);
}

/* the bar ---------------------------------------------------------------- */

.alloc-bar {
  position: relative; height: 72px; border-radius: var(--r);
  background: #08080a; border: 1px solid var(--line-2);
  display: flex; overflow: hidden; user-select: none; touch-action: none;
  transition: opacity .19s var(--ease);
}
.alloc-bar.swap { opacity: 0; }

.seg {
  position: relative; min-width: 0; height: 100%;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 14px; overflow: hidden; white-space: nowrap;
  transition: width .78s var(--ease), filter .3s var(--ease);
}
.alloc-bar.dragging .seg { transition: filter .3s var(--ease); }
.seg.hit { filter: brightness(1.32); }

.seg-name { font: 500 9.5px 'Geist Mono', monospace; letter-spacing: .13em;
            text-transform: uppercase; color: var(--txt-5); }
.seg-pct { font: 600 19px 'Geist Mono', monospace; font-variant-numeric: tabular-nums;
           letter-spacing: -.035em; color: var(--txt-hero); margin-top: 3px; }
.seg.tight { padding: 0 9px; }
.seg.tight .seg-name { display: none; }
.seg.tight .seg-pct { font-size: 13px; }
.seg.vtight .seg-pct { display: none; }

.seg-creator { background: linear-gradient(165deg, #93f2b7, #5fd186); }
.seg-creator .seg-name { color: rgba(5, 46, 22, .55); }
.seg-creator .seg-pct { color: var(--accent-deep); }

.seg-job { background: #16161a; }
.seg-job + .seg-job { background: #1d1d22; }
.seg-job + .seg-job + .seg-job { background: #24242a; }
.seg-pumped { background: #101014; }
.seg-pumped .seg-pct { color: var(--txt-4); font-weight: 500; font-size: 14px; }

.handle {
  position: absolute; top: 0; height: 100%; width: 20px; margin-left: -10px;
  z-index: 5; cursor: col-resize; display: grid; place-items: center;
  transition: left .78s var(--ease);
}
.alloc-bar.dragging .handle { transition: none; }
.handle::before { content: ''; width: 1px; height: 100%; background: #08080a; }
.handle::after {
  content: ''; position: absolute; width: 3px; height: 22px; border-radius: 2px;
  background: rgba(255, 255, 255, .32); opacity: 0; transform: scale(.8);
  transition: opacity var(--t-fast), transform .22s var(--ease-2), background var(--t-fast);
}
.handle:hover::after, .handle.on::after { opacity: 1; transform: scale(1); }
.handle.on::after { background: var(--accent); }

.ticks { display: flex; justify-content: space-between; margin: 6px 1px 16px;
         font: 400 9.5px 'Geist Mono', monospace; color: #34343c; letter-spacing: .06em; }

/* the readout ------------------------------------------------------------ */

.demo-out { display: grid; grid-template-columns: minmax(0, 1fr) 236px; gap: 26px; align-items: start; }

.cqs { display: grid; }
.cq { display: grid; grid-template-columns: 7px 1fr auto; align-items: baseline; gap: 11px; padding: 8px 0; }
.cq + .cq { border-top: 1px solid var(--line); }
.cq-sw { width: 7px; height: 7px; border-radius: 2px; align-self: center; }
.cq-name { font-size: 12.8px; color: var(--txt-3); }
.cq-val { font: 600 14.5px 'Geist Mono', monospace; font-variant-numeric: tabular-nums;
          color: var(--txt-hero); letter-spacing: -.03em; }
.cq-val em { font-style: normal; font-size: 10.5px; color: var(--txt-5); margin-left: 3px; font-weight: 400; }
.cq.zero .cq-val { color: var(--txt-5); font-weight: 400; }

.demo-side { display: grid; gap: 12px; }
.vol { display: grid; gap: 7px; }
.vol .dim { font-size: 11.5px; }
.volwrap { display: inline-flex; align-items: center; gap: 3px; background: #08080a;
           border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 7px 11px;
           transition: border-color var(--t-fast); }
.volwrap:focus-within { border-color: var(--line-3); }
.volwrap span { color: var(--txt-5); font-size: 13px; }
#vol { width: 100%; background: none; border: 0; color: var(--txt-hero); font-size: 13.5px; font-weight: 600; padding: 0; }
#vol:focus { outline: none; }
.demo-side .btn { width: 100%; padding: 11px; }

/* preset dots ------------------------------------------------------------ */

.dots { display: flex; gap: 6px; margin-top: 16px; transition: opacity .3s var(--ease); }
.dots.off { opacity: 0; pointer-events: none; }
.dots i { width: 18px; height: 3px; border-radius: 2px; background: var(--line-3);
          transition: background .4s var(--ease), width .4s var(--ease); }
.dots i.on { background: var(--accent); width: 30px; }

/* the flying coin, appended to body by motion.js ------------------------- */
.coin-fly {
  position: fixed; left: 0; top: 0; z-index: 250; pointer-events: none;
  width: 9px; height: 9px; border-radius: 50%;
  box-shadow: 0 0 12px 1px currentColor;
}

/* ------------------------------------------------------------------ flow */

/* Scroll reveal is an enhancement, never a gate. The hidden state only
   applies once JS has armed it, so no-JS and a failed IntersectionObserver both
   render the page normally instead of a blank column. */
.rv { transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .rv:not(.seen) { opacity: 0; transform: translateY(18px); }

.flow { display: grid; grid-template-columns: 1fr 64px 1fr 64px 1.25fr; align-items: center; gap: 0; margin-bottom: 12px; }

.fnode {
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r);
  padding: 15px 16px; display: grid; gap: 5px; align-content: start;
}
.fnode b { font: 600 22px 'Geist Mono', monospace; letter-spacing: -.04em; color: var(--txt-hero); }
.fsub { font-size: 11.5px; color: var(--txt-5); }
.ftall b { display: none; }

.fsplit { display: grid; gap: 6px; margin-top: 3px; }
.fsplit span { display: grid; grid-template-columns: 7px 1fr auto; align-items: center; gap: 9px;
               font-size: 12.3px; color: var(--txt-3); }
.fsplit i { width: 7px; height: 7px; border-radius: 2px; }
.fsplit b { font-size: 12.6px; font-weight: 600; color: var(--txt); }

.d1 { background: #7ae0a0; } .d2 { background: #3f3f46; }
.d3 { background: #33333a; } .d4 { background: #1e1e24; }

/* the wire, with pulses running along it */
.fwire { position: relative; height: 1px; background: var(--line-2); }
.fwire i {
  position: absolute; top: -2px; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px 1px rgba(134, 239, 172, .6);
  animation: run 2.4s linear infinite;
}
.fwire i:nth-child(2) { animation-delay: .8s; }
.fwire i:nth-child(3) { animation-delay: 1.6s; }
@keyframes run {
  0%   { left: -4px; opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { left: calc(100% - 1px); opacity: 0; }
}

.fnote { font-size: 12px; max-width: 74ch; }

/* ----------------------------------------------------------------- stats */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
         gap: 1px; background: var(--line); border: 1px solid var(--line);
         border-radius: var(--r); overflow: hidden; margin: 54px 0; }
.st { background: var(--bg-2); padding: 15px 16px; display: grid; gap: 8px;
      transition: background var(--t-fast); }
.st:hover { background: var(--bg-3); }
.st b { font: 600 21px 'Geist Mono', monospace; letter-spacing: -.04em; color: var(--txt-hero); }

.empty { padding: 52px 24px; text-align: center; border-radius: var(--r);
         border: 1px dashed var(--line-2); background: var(--bg-2); display: grid; gap: 5px; }
.empty b { font-size: 13.5px; color: var(--txt-3); font-weight: 550; }
.empty span { font-size: 12.3px; color: var(--txt-5); }

.foot { display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
        margin-top: 66px; padding: 22px 0 52px;
        border-top: 1px solid var(--line-2); font-size: 11.8px; color: var(--txt-4); }
.foot a { transition: color var(--t-fast); }
.foot a:hover { color: var(--accent); }

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

@media (max-width: 900px) {
  .demo-out { grid-template-columns: 1fr; gap: 18px; }
  .flow { grid-template-columns: 1fr; gap: 0; }
  .fwire { width: 1px; height: 30px; justify-self: center; background: var(--line-2); }
  .fwire i { top: auto; left: -2px; animation-name: rundown; }
  @keyframes rundown {
    0% { top: -4px; opacity: 0; } 12% { opacity: 1; }
    88% { opacity: 1; } 100% { top: calc(100% - 1px); opacity: 0; }
  }
}

@media (max-width: 640px) {
  .nav { display: none; }
  .hero { padding: 40px 0 28px; }
  .hero .sub { font-size: 14.5px; }
  .demo { padding: 15px 14px 16px; border-radius: var(--r); }
  .alloc-bar { height: 62px; }
  .demo-h { gap: 10px; }
  .hint { display: none; }
  .stats { margin: 40px 0; }
  .foot { margin-top: 44px; }
}

/* --------------------------------------------------------------- kicker */

.kicker {
  display: inline-block; margin-bottom: 16px;
  font: 500 10px 'Geist Mono', monospace; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); padding: 4px 9px; border-radius: var(--r-xs);
  background: rgba(134, 239, 172, .08); border: 1px solid rgba(134, 239, 172, .2);
}

/* -------------------------------------------------------------- the stance
   The positioning, stated as a comparison rather than a paragraph. */

.stance { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 44px; align-items: center; }
.stance-l h2 { font-size: clamp(21px, 2.6vw, 29px); line-height: 1.12; letter-spacing: -.035em; max-width: 18ch; }
.stance-l p { margin-top: 14px; max-width: 52ch; font-size: 14px; line-height: 1.62; color: var(--txt-3); }
.stance-l p b { color: var(--txt-hero); font-weight: 600; }

.vs { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.vs-row {
  background: var(--bg-2); padding: 16px 18px; display: grid; gap: 6px;
  border-left: 2px solid transparent;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.vs-row b { font-size: 16px; font-weight: 600; color: var(--txt-2); letter-spacing: -.025em; }
.vs-row b em { font-style: normal; color: var(--txt-5); }
.vs-sub { font-size: 12px; color: var(--txt-5); }

.vs-row.on { border-left-color: var(--accent); }
.vs-row.on b { color: var(--txt-hero); }
.vs-row.on b em { color: var(--accent); }
.vs-row:hover { background: var(--bg-3); }

@media (max-width: 900px) {
  .stance { grid-template-columns: 1fr; gap: 26px; }
}

/* Sections were butting into each other: .rule.tall zeroes its own top margin,
   so the spacing has to come from the section. */
main > section { margin-bottom: 64px; }
main > section:last-of-type { margin-bottom: 0; }
.stats { margin: 0; }

@media (max-width: 640px) {
  main > section { margin-bottom: 44px; }
}

/* ------------------------------------------------------- the coin field
   Coins that ran on pump.fun, drifting behind the hero. Sits under everything,
   never catches a pointer, and is masked so it fades out where the text is. */

.coinfield {
  position: absolute; inset: 0 0 auto; height: 760px;
  z-index: 0; pointer-events: none; overflow: hidden;
  transform: translate3d(var(--px, 0), var(--py, 0), 0);
  transition: transform .9s cubic-bezier(.22, 1, .36, 1);
  /* Dim behind the headline rather than cut a hole in it. The first version
     removed the whole centre and, with the opacities this low, left nothing
     visible at all. */
  -webkit-mask-image:
    radial-gradient(120% 76% at 34% 30%, rgba(0,0,0,.34) 0%, rgba(0,0,0,.62) 42%, #000 76%),
    linear-gradient(#000 70%, transparent 99%);
  -webkit-mask-composite: source-in;
  mask-image:
    radial-gradient(120% 76% at 34% 30%, rgba(0,0,0,.34) 0%, rgba(0,0,0,.62) 42%, #000 76%),
    linear-gradient(#000 70%, transparent 99%);
  mask-composite: intersect;
}

.cf-chip {
  position: absolute; top: 0; left: 0;
  display: flex; align-items: center; gap: 9px;
  padding: 8px 14px 8px 8px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--line-2);
  white-space: nowrap; will-change: transform;
  /* transform is written by the rAF loop in lib/coinfield.js */
}
.cf-chip img { width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto; }
.cf-t { font: 600 13px 'Geist Mono', monospace; letter-spacing: -.02em; color: var(--txt-hero); }
.cf-n { font: 400 12px Geist, sans-serif; color: var(--txt-4); }

/* the hero has to sit above the field */
.hero, .demo { position: relative; z-index: 1; }

.hero-foot {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 18px; max-width: 54ch;
  font-size: 12px; line-height: 1.5; color: var(--txt-5);
}
.hero-dot {
  flex: 0 0 auto; width: 5px; height: 5px; border-radius: 50%;
  background: var(--txt-5); margin-top: 7px;
}

@media (max-width: 760px) {
  .coinfield { height: 520px; }
  .cf-chip { padding: 6px 11px 6px 6px; gap: 7px; }
  .cf-chip img { width: 24px; height: 24px; }
  .cf-n { display: none; }
}

/* Jupiter returns mixed-case symbols (Pnut, pippin, Titcoin). Tickers are not
   mixed case, so normalise rather than hand-editing the generated list. */
.cf-t { text-transform: uppercase; }

/* Chips were too small to read the token art. Scaled up here rather than only in
   the layer scale, so the text keeps its proportion to the image. */
.cf-chip { padding: 9px 16px 9px 9px; gap: 10px; }
.cf-chip img { width: 38px; height: 38px; }
.cf-t { font-size: 14.5px; }
.cf-n { font-size: 13px; }

@media (max-width: 760px) {
  .cf-chip { padding: 7px 12px 7px 7px; gap: 8px; }
  .cf-chip img { width: 30px; height: 30px; }
  .cf-t { font-size: 13px; }
}

/* The field is bold now, so the headline needs its own protection rather than
   the field being dimmed back down. A soft scrim sits between them: text always
   wins its own box, the coins stay visible everywhere else. */
.hero { isolation: isolate; }
.hero::before {
  content: ''; position: absolute; z-index: -1;
  left: -6%; right: 18%; top: -8%; bottom: -14%;
  background: radial-gradient(68% 62% at 28% 48%,
    rgba(11, 11, 14, .93) 0%, rgba(11, 11, 14, .78) 42%, transparent 78%);
  pointer-events: none;
}
@media (max-width: 760px) {
  .hero::before { left: -10%; right: -10%; }
}

/* Dialled back a touch from the bigger pass. */
.cf-chip { padding: 8px 14px 8px 8px; gap: 9px; }
.cf-chip img { width: 33px; height: 33px; }
.cf-t { font-size: 13.5px; }
.cf-n { font-size: 12px; }
