/* Sticky positioning follows the document viewport through the page shell. */
.site-shell { overflow: clip; }

.liquidity-story {
  --paper: #f5eee3;
  --fixed-alpha: 0;
  --relative-alpha: 0;
  --fixed-model: 1;
  --relative-model: 0;
  position: relative;
  height: 207vh;
  height: 207svh;
  color: var(--paper);
  isolation: isolate;
  border-bottom: 1px solid #322b24;
  background: radial-gradient(ellipse at 54% 62%, #19120e 0%, #100e0c 45%, #0e0d0c 84%);
}
.liquidity-pin {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100svh;
  padding: clamp(24px, 4.5vh, 56px) 4.5% clamp(20px, 4vh, 44px);
  overflow: clip;
}
.liquidity-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 0 0 clamp(14px, 2.3vh, 25px);
  border-bottom: 1px solid #eee0c922;
}
#liquidity-title, .liquidity-static-label {
  color: var(--paper);
  font: 600 clamp(44px, 5.8vw, 100px)/.94 'Barlow Condensed','Arial Narrow',sans-serif;
  letter-spacing: -.035em;
}
#liquidity-title { display:grid; }
#liquidity-title span { grid-area:1/1; }
.fixed-title { opacity:var(--fixed-model); }
.relative-title { opacity:var(--relative-model); }
.liquidity-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 1480px;
  max-height: 720px;
  margin: auto;
}
.liquidity-canvas { display: block; width: 100%; height: 100%; }
.liquidity-static,.liquidity-static-label { display: none; }
.liquidity-cards {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.liquidity-cards--fixed { opacity: var(--fixed-alpha); }
.liquidity-cards--relative { opacity: var(--relative-alpha); }
.liquidity-callout {
  position: absolute;
  width: clamp(185px, 18.6vw, 280px);
  padding: clamp(13px,1.45vw,22px);
  border-radius: 24px;
}
.liquidity-cards[aria-hidden="false"] .liquidity-callout { pointer-events: auto; }
.liquidity-callout h3 { color: #fff7e9; font: 550 clamp(15px,1.27vw,22px)/1.16 var(--sans); letter-spacing: -.035em; margin: 0 0 .55em; }
.liquidity-callout p { color: #d7ccc0; font: 400 clamp(11px,.89vw,15px)/1.53 var(--sans); margin: 0; }
.liquidity-cards--fixed article:first-child { left: 0; top: 6%; }
.liquidity-cards--fixed article:last-child { right: 0; top: 4%; }
.liquidity-cards--relative article:first-child { left: 2%; top: 21%; }
.liquidity-cards--relative article:last-child { right: 2%; top: 55%; }

@media(max-width:960px) {
  .liquidity-story { height: 196vh; height: 196svh; }
  .liquidity-pin { padding: clamp(20px,3.5svh,38px) 4% 20px; }
  .liquidity-heading { gap: 8px; align-items: start; flex-direction: column; padding-bottom: 12px; }
  #liquidity-title, .liquidity-static-label { font-size: clamp(37px,8vw,64px); }
  .liquidity-stage {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    padding-bottom: 3px;
    max-height: 730px;
  }
  .liquidity-canvas { grid-area: 1/1; min-height: 0; }
  .liquidity-cards {
    position: relative;
    inset: auto;
    grid-area: 2/1;
    display: grid;
    align-self: start;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 8px;
    padding-top: 6px;
  }
  .liquidity-cards .liquidity-callout {
    position: relative;
    inset: auto !important;
    width: auto;
    padding: 12px;
  }
  .liquidity-callout h3 { font-size: clamp(14px,2.5vw,18px); }
  .liquidity-callout p { font-size: clamp(11px,1.7vw,14px); line-height: 1.45; }
}

/* Both comparisons occupy independent rows for reduced motion and short windows. */
.liquidity-story.is-static { height: auto; }
.is-static .liquidity-pin { position: relative; height: auto; }
.is-static .liquidity-stage { display: flex; flex-direction: column; max-height: none; }
.is-static .liquidity-canvas,.is-static .liquidity-static { display: block; height: clamp(235px,43vw,555px); width: 100%; }
.is-static .liquidity-static { height: clamp(370px,55vw,700px); }
.is-static .liquidity-static-label { display: block; align-self: start; margin: clamp(30px,5vh,56px) 0 8px; }
.is-static .liquidity-cards { position: static; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; max-width: 850px; width: 100%; margin: auto; opacity: 1; }
.is-static .liquidity-cards .liquidity-callout { position: relative; inset: auto !important; width: auto; }
.is-static .relative-title { display:none; }
.is-static .fixed-title { opacity:1; }
@media(max-width:420px) {
  .is-static .liquidity-cards { grid-template-columns: 1fr; gap: 6px; }
  .is-static .liquidity-callout { padding: 12px 15px; }
}
.liquidity-cards--relative article:nth-child(2) { right: 1%; top: 34%; }
.liquidity-cards--relative article:last-child { left: 2%; right: auto; top: 66%; }
@media(max-width:960px) {
  .liquidity-cards--relative article:last-child { grid-column: 1/-1; }
  .liquidity-cards--relative article:last-child h3 { display:inline; margin-right:.4em; }
  .liquidity-cards--relative article:last-child p { display:inline; }
}
.terminal-token { width:22px; height:22px; object-fit:contain; border-radius:50%; }
#pool-info { display:inline-grid; place-items:center; text-decoration:none; }
.scene-app-link {
  position:absolute; right:2%; bottom:8%; display:inline-flex; align-items:center; justify-content:center; gap:20px;
  padding:13px 19px; border:1px solid #b66031; border-radius:10px; color:#ffead7; text-decoration:none;
  font:600 14px var(--sans); background:linear-gradient(115deg,#110d0a 22%,#32180c 40%,#783714 48%,#23130b 56%,#110d0a 76%);
  background-size:270% 100%; box-shadow:0 0 17px #ff64182e,inset 0 1px 0 #ef9b623d;
  animation:scene-app-shimmer 4.5s ease-in-out infinite;
}
.scene-app-link[hidden] { display:none; }
.scene-app-link:focus-visible { outline:2px solid #e4e0db; outline-offset:3px; }
@keyframes scene-app-shimmer { 0%,20% {background-position:100% center} 75%,100% {background-position:0% center} }
@media(max-width:960px) { .scene-app-link {position:static;grid-area:3/1;justify-self:end;margin:9px 0 2px;padding:9px 16px;} }
.is-static .scene-app-link {position:static;align-self:flex-end;margin:15px 0 0;}
@media(prefers-reduced-motion:reduce) { .scene-app-link {animation:none;} }

@media(max-width:960px) { .scene-app-link.liquid-glass { position:relative; inset:auto; } }
.is-static .scene-app-link.liquid-glass { position:relative; inset:auto; }

.fixed-bin-layer { position: absolute; inset: 0; pointer-events: none; }
.fixed-bin-layer .fixed-bin {
  position: absolute;
  pointer-events: auto;
  transform-origin: bottom center;
  border-radius: 8px;
  --surface-tint: rgb(43 29 23 / 32%);
}
.liquidity-canvas { position: relative; pointer-events: none; }

.relative-layout:not([hidden]) {
  height:100%; display:grid; grid-template-columns:minmax(0, .9fr) minmax(0,1.1fr);
  align-items:center; gap:clamp(24px,5vw,90px);
}
.relative-copy { display:grid; gap:14px; }
.mechanism-metal {
  background:#000; color:#fff; isolation:isolate; border:0; border-radius:24px;
  box-shadow:none;
}
.relative-panel { position:relative; padding:clamp(18px,2vw,32px); }
.relative-panel h2 { font-size:clamp(25px,3.1vw,54px); line-height:1; }
.relative-panel section { border-top:1px solid #343434; margin-top:1em; padding-top:1em; }
.relative-panel h3 { font-size:clamp(15px,1.3vw,20px); }
.relative-panel p { margin:.4em 0 0; color:#ccc; font-size:clamp(12px,1vw,15px); line-height:1.45; }
.relative-copy .scene-app-link { position:relative; inset:auto; margin:0; justify-self:start; animation:none; }
.relative-layout .liquidity-static { display:block; width:100%; height:100%; min-height:0; }
.is-static .relative-layout { height:auto; margin-top:36px; }
.is-static .relative-layout .liquidity-static { height:clamp(290px,42vw,620px); }
@media(hover:hover) and (prefers-reduced-motion:no-preference) {
  .mechanism-metal { transition:scale 300ms cubic-bezier(.4,0,.2,1); }
  .mechanism-metal:hover { scale:1.05; }
}
@media(max-width:650px) {
  .relative-layout:not([hidden]) { grid-template-columns:1fr; grid-template-rows:auto minmax(0,1fr); gap:8px; }
  .relative-panel { padding:14px 17px; }
  .relative-panel section { margin-top:7px; padding-top:7px; }
  .relative-copy { gap:8px; }
}

.liquidity-story::before {
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background-image:linear-gradient(90deg,rgba(220,196,168,.11) 1px,transparent 1px),
                   linear-gradient(rgba(220,196,168,.11) 1px,transparent 1px);
  background-size:var(--bin-step,60px) var(--bin-step,60px);
  background-position:var(--bin-left,0px) var(--bin-base,0px);
}
.is-static .liquidity-stage {display:grid;grid-template-columns:minmax(0,1fr);gap:0}
.is-static .fixed-bin-layer {grid-area:1 / 1 / 3 / 2}
.is-static .liquidity-canvas {grid-area:1/1}
.is-static .liquidity-cards--fixed {position:relative;grid-area:2/1}

#mechanism.liquidity-story {height:auto}
#mechanism .liquidity-pin {position:relative;top:auto;height:auto;display:block}
#mechanism .liquidity-stage {height:clamp(420px,70svh,720px);margin:0 auto}
#mechanism .relative-layout {height:auto;min-height:65svh;width:min(100%,1480px);margin:clamp(28px,5vh,72px) auto 0}
#mechanism .relative-layout .liquidity-static {height:clamp(290px,48vw,620px)}
#mechanism .liquidity-cards--fixed {opacity:1;pointer-events:none}
#mechanism .liquidity-callout {pointer-events:auto}
@media(max-width:960px) {#mechanism .liquidity-stage {height:auto;grid-template-rows:clamp(230px,44svh,460px) auto}}
